c++

if i want to play mp3's what is the difference between lame and MCI(VFW32) ?

Hello basic question , i need to play mp3's in my application in windows when goggling i got allot of tutorials about VFW32.lib to play mp3's and i know lame , what is the best option for playing mp3's in c++? ...

Partially truncating a stream (fstream or ofstream) in C++

Hi, I am trying to partially truncate (or shorten) an existing file, using fstream. I have tried writing an EOF character, but this seems to do nothing. Any help would be appreciated... ...

Overloaded operator is never called in C++

I'm writing a math library as a practical exercise. I've run into some problems when overloading the = operator. When I debuged it, I noticed that the call to vertex1 = vertex2 calls the copy constructor instead. In the header file I have: //constructors vector3(); vector3( vector3 &v ); vector3(float ix, float iy, float iz); //opera...

GetRawInputData vs GetAsyncKeyState()

Well, I'm trying to avoid using the deprecated DirectInput. But I need, at each "frame" or "iteration" of the game to snatch ALL KEY STATES so that I can act accordingly. For example, if the player is down on the VK_RIGHT key then he will move just a smidgen right on that frame. The problem with WM_INPUT messages is they can appear an...

How to print each function call during execution in WinDbg?

I am debugging an application written in VC++. How do i make WinDbg print the function name and all the values of the arguments to the functions during execution of the debuged process? ...

boost::python Export Custom Exception

I am currently writing a C++ extension for Python using Boost::Python. A function in this extension may generate an exception containing information about the error (beyond just a human-readable string describing what happened). I was hoping I could export this exception to Python so I could catch it and do something with the extra inf...

What library I can use for sending POST and GET requests in C++?

Possible Duplicate: What C++ library should I use to implement a HTTP client? What library I can use for sending POST and GET requests in C++ ...

Which IDE Should One Use For C++ on Windows

Which IDE for C++ i should use on Windows? Is there an IDE with support for editing on SSH(on linux server)? I have very big C++ project without docs and editing it with text editor very difficult =( ...

Adding C++ Object to Objective-C Class

I'm trying to mix C++ and Objective-C, I've made it most of the way but would like to have a single interface class between the Objective-C and C++ code. Therefore I would like to have a persistent C++ object in the ViewController interface. This fails by forbidding the declaration of 'myCppFile' with no type: #import <UIKit/UIKit.h> ...

Is there a way to find out whether a class is a direct base of another class?

Hi I'm wondering whether there is a way to find out whether a class is a direct base of another class i.e. in boost type trait terms a is_direct_base_of function. As far as I can see boost doesn't see to support this kind of functionality which leads me to think that its impossible with the current C++ standard. The reason I want it is...

how do I get items from listview to use them in combobox

Hello, I try to get the items from a listview to use them in a combobox, so I can select one of them to create an order. Im my application I use 3 listview in separate forms to store some informations. Based on the informations stored there I want to create a order. I'm using visual c++ 2008 express. Please help!!! ...

What does the "c" mean in cout, cin, cerr and clog?

What does the "c" mean in the cout, cin, cerr and clog names? I would say char but I haven't found anything to confirm it. ...

generate sha256 with openssl and C++

Hello, I'm looking to create a hash with sha256 using openssl and C++. I know there's a similar post about this here: http://stackoverflow.com/questions/918676/generate-sha-hash-in-openssl, but I'm looking to specifically create sha256. UPDATE: Seems to be a problem witht he include paths. It can't find any openssl functions even...

program doesn't work after FTP

I was working on a c++ project on a remote linux server via ssh. I decided I wanted to test the files on my own machine using valgrind. I FTP-ed the project directory from the remote server to my own machine, compiled, and attempted to run. I got the message: Error opening /proc/96855/stat And based on the different arguments I ...

Pass by reference impossible?

I'm trying to use a for_each loop in my code, but I'm getting the following error: cannot convert parameter 1 from 'std::pair<_Ty1,_Ty2>' to 'std::pair<_Ty1,_Ty2> &' here's the offending code: typedef stdext::hash_map< std::string, std::list<DefaultTestContext> > CompleteTestList; static void RunMappedTests(pair<string, ...

Changing background of text in edit control

can you change the background of text in area of edit control that would stay static? ...

binding to member variables

The following example from boost bind does not work for me: #include <boost/bind.hpp> struct A { int data; }; int main() { A a; boost::bind(&A::data, _1)(a) = 1; } error: assignment of read-only location 'boost::bind [with A1 = boost::arg<1>, M = int, T = A](&A::data, (<unnamed>::_1, boost::arg<1>())).boost::_bi::bind_t<...

Faster method for exporting embedded data

For some reasons, i'm using the method described here: http://geekswithblogs.net/TechTwaddle/archive/2009/10/16/how-to-embed-an-exe-inside-another-exe-as-a.aspx It starts off from the first byte of the embedded file and goes through 4.234.925 bytes one by one! It takes approximately 40 seconds to finish. Is there any other methods for ...

URLDownloadToFile API, how can it be used asynchronously?

How can this API URLDownloadToFile be used asynchronously? I need to show the progress of the download via SendMessage to a client window, which can't be done as the API appears to be synchronous and it never sends the OnProgress until the download completes. I have also seen some example codes involving IMoniker interface, but I can't f...

Graphics Gems IV. Binary Image Thinning Using Neigborhood Maps

What's mean this expression in algorithm? p = ((p<<1)&0666) | ((q<<3)&0110) | (Image->scanLine(y+1)[x+1] != 0); Algorithm "Binary Image Thinning Using Neigborhood Maps" in a book "Graphics Gems IV": static int masks[] = {0200, 0002, 0040, 0010}; uchar delete_[512] = { 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,1,0,0,1,1, ...