c++

hooked endscene, ID3DXSprite::draw stops working after a few seconds

I have hooked the endscene of a game, and want to draw my desktop as an overlay using a ID3DXSprite. (I don't want to run my game minimized and want to be able to look at my desktop by pressing a key) So it works, but after a few seconds it will just stop showing up. To be precise: it works while the screen of the game is still black an...

Filtering out namespace errors when parsing partial XML via libxml2 in C++

Hi guys, I have the need to parse partial XML fragments (which are presented as std::string), such as this one: <FOO:node>val</FOO:node> as xmlDoc objects in libxml2, and because these are fragments, I keep getting the namespace error : Namespace prefix FOO on node is not defined errors spit out into STDERR. What I am looking for is ...

About returning references to objects

No, this isn't about the mistake everyone makes of passing locals. I'm just trying to understanding returning a reference to an object you pass in (I'm reading through primer). So if I have a function like this: const foo & foo::function2(const foo & val) const { using namespace std; return *this; } and then I'm in main doing...

Which is the most frequent uses of type in C++

Which is the most frequent uses of type in C++? int? bool? pointer? .... thanks ...

How to include a template member in a class?

I am attempting to make a class that has a template object member inside of it. For example mt_queue_c<int> m_serial_q("string"); However, when I do this it fails to compile. If I move this line outside of the class definition so that it becomes a global object, it compiles fine. I condensed the code into the smallest possible fai...

Is there a way to do this?

Here is my issue. I have a std::vector<POINTFLOAT> Which stores verticies. The issue is that Vertex buffer objects take in a pointer to an array of float. Therein lies my problem. I cannot give it an array of pointfloat. Is there a way that I could instead push pointers to the individual components of each vertex without pushing in copie...

Tool to Map #include's

Is there a tool available which will take a set of source files and map (in graphic fashion) how they are linked via #include? I would like to see where there are any circular references. ...

change value from array

int main() { int Count, Sum = 0; int Group[10]; cout << "-303 to stop\n"; for(Count = 0; Count < 10; Count++) { cout << "Enter a value: "; cin >> Group[Count]; if(Group[Count] == -303) break; } int T; for(T = 0; T < Count; T++) Sum += Group[T]; for(T = 0; T < Count...

How do I write a program which can control a device driver?

I've got a laser profiling system; the included software has a few bugs and missing features that I'd like to correct. I have the source code for this software which compiles but subsequently will not run. The device driver for the hardware is already installed (Windows 7 is the platform, though XP is a likely target as well); I'd like...

Call a function twice with Assembly and C++

Hi, I have a code that changes the function that would be called, to my new function, but I don't want to call only my new function, I also want to call the old one. This is an example, so you can understand what I'm saying: If I disassemble my .exe, I will look at this part: L00123456: mov eax, [L00654321] //doesn't matter ...

share queue between parent and child process in c++

I know there are many way to handle inter-communication between two processes, but I'm still a bit confused how to deal with it. Is it possible to share queue (from standard library) between two processes in efficient way? Thanks ...

What has to be Glib::init()'ed in order to use Glib::wrap?

So I'm trying to make use of a GtkSourceView in C++ using GtkSourceViewmm, whose documentation and level of support give me the impression that it hasn't been very carefully looked at in a long time. But I'm always an optimist :) I'm trying to add a SourceView using some code similar to the following: Glib::RefPtr<gtksourceview::Sourc...

Using both .so and .dll on Windows

I am writing a program in windows in C++ for which users will be able to compile extensions in the form of dynamic-link libraries (windows) or shared object files (linux). On windows, you use the LoadLibrary function to load a dll. Is it possible to do the same for .so files on windows? And vice versa, load .dlls on linux? ...

any chart / graph / plotting c c++ library which is similar as bloomberg chart, with mouse interaction on plotted line, and multilayer plot

any chart / graph / plotting c c++ library which is similar as bloomberg chart, with mouse interaction on plotted line, and multilayer plot? gnuplot is very powerful but it seems to me it can feed in data but no callback to mouse action and no manipulation on plotted line / chart, e.g. over mouse over particular line and I would dump th...

Deleting a reference

Is this valid? An acceptable practice? typedef vector<int> intArray; intArray& createArray() { intArray *arr = new intArray(10000, 0); return(*arr); } int main(int argc, char *argv[]) { intArray& array = createArray(); //.......... delete &array; return 0; } ...

Embedding Third Party Fonts as resource for Win32 Application

Hi, I was wondering how i can embed a third party font into my app( and use it ) so i can distribute my app with the font of my choice for users who do not have the font installed on their systems. Is this possible, or do i have to distribute the font if i want the users to be able to use the font in question. Thanks. ...

Make caption icon become drag source like explorer window

I made an editor which written in pure WinAPI. Some users want the caption icon become a drag source of the file that opened in editor, like what the explorer window does. I have no idea to implement such feature. Can someone give me example please? ...

Is there a (Linux) g++ equivalent to the /fp:precise and /fp:fast flags used in Visual Studio?

Background: Many years ago, I inherited a codebase that was using the Visual Studio (VC++) flag '/fp:fast' to produce faster code in a particular calculation-heavy library. Unfortunately, '/fp:fast' produced results that were slightly different to the same library under a different compiler (Borland C++). As we needed to produce exactly...

WinAPI Write "Edit" Dialog to Pipe (Error: Stack around variable 'x' was corrupted)

Hello everyone. It seems I figured out most of my problems by simply multi-threading my application! However, I am running into a little bit of an error: "Stack around variable 'x' was corrupted." It works properly (after hitting abort on the Debug Error), but obviously I cannot have an error everytime someone runs the application. So he...

Is there a program to convert assembly to C++?

Is there a program that will convert assembly to C or C++? I did a lot of searching but I could not find anything that works. There is a program called "Boomerang"; it looks great and just want I wanted, but it's very unstable and crashes when I try to use it. (boomerang) Are there any other free programs that will do that? ...