c++

svg example in C/C++

Hi, Can someone provide an example of how to load a .svg file and display it using C/C++ and any library? I'm wondering if you will use SDL, cairo, or what. ...

VS2008 C++ Compiler error?

this compiles :-) string name; name = 1; this does not: string name = 1; any thoughts? I know that this is wrong. . . that is not the point. The first gives a smiley face. ...

Save bitmap to video (libavcodec ffmpeg)

Hello, I'd like to convert a HBitmap to a video stream using libavcodec. I get my HBitmap using: HBITMAP hCaptureBitmap =CreateCompatibleBitmap(hDesktopDC, nScreenWidth, nScreenHeight); SelectObject(hCaptureDC,hCaptureBitmap); BitBlt(hCaptureDC,0,0,nScreenWidth,nScreenHeight,hDesktopDC,0,0,SRCCOPY); And I'd like to convert it to YU...

custom data iostream

I have a data structure defined as struct myDataStruct { int32_t header; int16_t data[8]; } and I want to take a character stream and turn it into a myData stream. What stream class should I extend? I would like to create a custom stream class so that I can do things like myDataStruct myData; myDataStruct myDataArray[10]; my...

best way to generate options in VisualStudio Project files

I am generating VisualStudio C++ project files from a build system. The compiler options in the XML for the project file are in a different format from the command line options specified for the compiler. I need to get from command line options for cl.exe to the project file options for the VCCLCompilerTool. 1 - Is anyone aware of an o...

Regex Syntax - Help

Hi, I need to process a HTML content and replace the IMG SRC value with the actual data. For this I have choose Regular Expressions. In my first attempt I need to find the IMG tags. For this I am using the following expression: <img.*src.*=\s*".*" Then within the IMG tag I am looking for SRC="..." and replace it with the new SRC val...

free non-gpl data compression libraries

Hello, i'm writing project that stores data, so i need to compress it. I've tried zlib but it's bottleneck of my project. So maybe there is faster solution. I don't need a great compress ratio, but i'm looking for really fast compression. Are there any other data compression libraries except zlib, that are really free and can be used in ...

Problem with file loop and reading into map

The while loop I have while reading in from a file doesn't break. I'm not sure what the problem is. If you need any more information just ask. Code: #include <string> #include <map> #include <fstream> #include <iostream> #include <iterator> using namespace std; class Customer { public: string name; string address; Custome...

Is there any method to move some source code from on folder to another easily in vs2005?

I'v write lots of code in c++ vs2005. I decided to move some source code to other folder. It make lots of compile errors, because of include error, Is there a tool to move source code easily, which can modify .h include automaticly? ...

Should I attempt to fix an arguably poor design decision in a 3rd party library?

My project involves Qt plus and unnamed 3rd party physics simulation library. The way the physics library works is that physical bodies cannot create themsleves; the "world" must instantiate them so that they can be added to the world immediately. My project creates a wrapper around these physical bodies to add some extra functionality,...

Any valid reason for code duplication?

I'm currently reviewing a very old C++ project and see lots of code duplication there. For example, there is a class with 5 MFC message handlers each holding 10 identical lines of code. Or there is a 5-line snippet for a very specific string transformation every here and there. Reducing code duplication is not a problem in these cases a...

Best way to explain declarative fallacy in C++?

Is anyone willing to help me craft a good explanation of why the following code is not correct, in that the author is attempting to write C++ code declaratively rather than procedurally? const double NEWTONS_PER_POUND = 4.448; int main() { double pounds, newtons; pounds = newtons/NEWTONS_PER_POUND; /* pounds equals 'unassigned va...

finding Image shift

Hi, How to find shift and rotation between same two images using programming languages vb.net or C++ or C#? Please help urgent ...

ImpersonateLoggedOnUser and starting a new process that uses ocx fails.

I write a c++ windows application (A), that uses LogonUser, LoadUserProfile and ImpersonateLoggedOnUser to gain the rights of another user (Y). Meaning the A starts using the user that is logged on on the workstation (X). If the user wants to elevate his rights he can just press a button and logon as another user without having to log hi...

stop python object going out of scope in c++

Is there a way to transfer a new class instance (python class that inherits c++ class) into c++ with out having to hold on to the object return and just treat it as a c++ pointer. For example: C++ object pyInstance = GetLocalDict()["makeNewGamePlay"](); CGEPYGameMode* m_pGameMode = extract< CGEPYGameMode* >( pyInstance ); pyth: cla...

What is the difference between .LIB and .OBJ files? (Visual Studio C++)

I know .OBJ is the result of compiling a unit of compilation and .LIB is a static library that can be created from several .OBJ, but this difference seems to be only in the number of units of compilation. Is there any other difference? Is it the same or different file format? I have come to this question when wondering if the same stati...

Windows 7 Libraries

Hi there I hope someone can help me with this as I'm unable to find the right method to do it. I am currently developing an application that should ,in a part of it, be able to enumerate all the Windows Libraries and display their contents as well. For now I was able to get the included folders for all the standard windows 7 libraries, ...

C++ Vector Pointers to Objects

I'm using a vector of pointers to objects. These objects are derived from a base class, and are being dynamically allocated and stored. For example, I have something like: vector<Enemy*> Enemies; and I'll be deriving from the Enemy class and then dynamically allocating memory for the derived class, like this: enemies.push_back(new M...

Converting unmanaged C++ code to C#

Anyone with pointers to a tool/utility for converting unmanaged c++ to c#? I have tried the http://www.pinvoke.net/ site but I cant find reference to this API AddUsersToEncryptedFile on this question. ...

Access member variables of derived class object pointed to by a pointer to its base class

Hi All, I have one base class and two classes derived from it. I have several virtual functions in the base class so I create a pointer to the base class and use this pointer to access these methods. Now I want to access member variable of derived class (this variable is not present in the base class) using the pointer to base class wh...