I am working on redhat 5.2 on a project which spans several disparate organizations. Each organization delivers libraries which have been compiled with various versions of g++. Currently, these versions include 4.1.1, 4.1.2 and 4.3.1. I am trying to link all the libraries together into an executable using 4.1.2. What, if any, problem...
I'm working on a C++ project with a large number of classes (150+), each of which has anywhere from 10 to 300 fields or so. I would really like to be able to provide a scripting interface for testing purposes so that I can code callbacks that don't require any re-compilation. I'd like to do this in Lua since I'm more familiar with its C ...
I saw another post that suggested the following:
String^ clistr = gcnew String("sample");
IntPtr p = Marshal::StringToHGlobalAnsi(clistr);
char *pNewCharStr = static_cast<char*>(p.ToPointer());
Marshal::FreeHGlobal(p);
I just wanted to check and see if there is any other, preferred way, or if anything was wrong with the above?
...
I have an unmanaged C++ exe that I could call from inside my C# code directly (have the C++ code that I could make a lib) or via spawning a process and grabbing the data from the OutputStream. What are the advantages/disadvantages of the options?
...
I am looking for a C++ library or component which would ideally be cross-platform, but will first only be needed for Win32.
The requirements are:
one to 10 updates per second
good documentation and samples
easy to use
cross platform (optional)
Basically we have some data derived from financial market data feeds and we do some calcul...
I have this struct in C++:
struct TEXTMSGSTR
{
HWND Sender;
wchar_t Text[255];
//wchar_t *Text;
};
and in C#:
public struct TEXTMSGSTR
{
public IntPtr Sender;
public ? Text;
}
which I am sending as part of a COPYDATASTRUCT message from unmanaged to managed code. What would be the correct construction of the stru...
Years ago I wrote some code to "publish" data for perfmon to consume. Using those counters is pretty well documented, but I found it challenging to find (at the time) good documentation and sample code to publish the data for perfmon.
Does anyone know where I can get this documentation? I also seem to recall some class wrappers, but I m...
Can I have a method which takes arguments that are denoted with the same names as the members of the holding class? I tried to use this:
class Foo {
public:
int x, y;
void set_values(int x, int y)
{
x = x;
y = y;
};
};
... but it doesn't se...
I'm using the libpq library in C for accessing my Postgresql database. The application inserts a piece of data fed from a queue. When there is a lot of data and it's inserting very quickly it randomly inserts and empty row into the table. Before I even perform the insert I check to make sure that the length of the text being inserted is ...
I have a class that references a bunch of other classes. I want to be able to add these references incrementally (i.e. not all at the same time on the constructor), and I want to disallow the ability to delete the object underlying these references from my class, also I want to test for NULL-ness on these references so I know a particul...
I am developing an application that sits in the system tray and can perform actions on the active window. But when the icon in the system tray is clicked, GetForegroundWindow() returns the taskbar. I need to get the window that was active before the taskbar was.
I've tried enumerating the desktop window with EnumWindows and GetWindow, b...
Hello all :)
I've got a large (read: nightmare) method which has grown over the years to support my project's ever growing list of commandline arguments. I mean several pages of readme docs for brief blurbs per argument.
As I've added each feature, I've simply "registered" a way of handling that argument by adding a few lines to that m...
I am running a simulation with a lot if bunch of initial memory allocations per object. The simulation has to run as quickly as possible, but the speed of allocation is not important. I am not concerned with deallocation.
Ideally, the allocator will place everything in a contiguous block of memory. (I think this is sometimes called a...
A while ago I stumbled upon a C++ gem, a set of classes that through operator overloading and possibly some preprocessor tricks, let you define variables using in-code ASCII art:
Line x = |-----|; //x is 5
Line y = |---|; //y is 3
Rectangle r = +---+
| |
+---+; //r is 3 by 1
and IIRC, it even had...
Long version...
A co-worker asserted today after seeing my use of while (1) in a Perl script that for (;;) is faster. I argued that they should be the same hoping that the interpreter would optimize out any differences. I set up a script that would run 1,000,000,000 for loop iterations and the same number of while loops and record the ...
What is the difference between association, aggregation and composition? Please explain in terms of implementation.
...
hi,
i want to know whether
SymbianCryptographyLibraries api in symbian is private or publc
bcoz i have to use for my application
bye
...
I'm writing a screen saver type app that needs to stop the user from accessing the system without typing a password. I want to catch/supress the various methods a user might try to exit the application, but all research I do seems to point me to "you can't".
Anything in C# or C++ would be great.
I've thought of disabling the keyboard,...
I have 8 sorted lists that I need to merge into 1 sorted list. I don't know the best way to do this. I was thinking of the following:
void merge_lists_inplace(list<int>& l1, const list<int>& l2)
{
list<int>::iterator end_it = l1.end();
--end_it;
copy(l2.begin(), l2.end(), back_inserter(l1));
++end_it;
inplace_merge(l...
Does anyone know the syntax for an out-of-declaration template method in a template class.
for instance:
template<class TYPE>
class thing
{
public :
void do_very_little();
template<class INNER_TYPE>
INNER_TYPE do_stuff();
};
The first method is defined:
template<class TYPE>
void thing<TYPE>::do_very_little()
{
}
How do I do...