c++

sleep for many days with resolution of microseconds

Is there a way to put a thread to sleep for many days with a resolution of microseconds? usleep can only put the thread to sleep for 1000000 and sleep works in second steps. Is there a way to, may be, use both sleep and usleep to achieve this? ...

WCHAR to LPCWSTR

when i use CreateFile function like below ...it gives me valid handle HANDLE hDevice = CreateFile (TEXT("\\\\.\\G:"), 0,FILE_SHARE_READ | FILE_SHARE_WRITE, // share mode NULL, OPEN_EXISTING, 0, NULL); if( hDevice == INVALID_HANDLE_VALUE ) { qDebug()<<"In valid handle"; } else { qDebug()<<"valid han...

messages for cstatic

hi all, 1.i have derived a class from CStatic called CLed_arr. 2.a cstatic control named IDC_leds was added to the dialog window in resource editor. 3.a member var called m_led_arr of the class CLed_arr was created for this IDC_leds. 4.the class CLed_arr contains an array Led[16] of objects of class CLed. 5.the class CLed itself is deri...

GOF State Pattern State Transition Implementation Issues

Firstly, can anyone explain how a state object can be shared when the state object has no instance variables ? This text is taken from GOF, page 308, item 3 (consequences section): The state object can be shared. If state objects have no instance variabkes - that is, the state they represent is encoded entirely in their type...

boost::thread & member function

Hi all, I've facing this problem when trying to use boost::thread: unresolved external symbols: public: __thiscall boost::thread::~thread(void) public: __thiscall boost::thread::thread(void) Does anyone have any idea? ...

whats an example usage of c++ pointers?

i'm self-teaching c++ and i get how pointers work. but the doc i'm using is quite literal and the examples don't really go into why or when pointers would be used. a couple of real world examples would help me retain the knowledge. ...

How to call Matlab form C++ code?

I am trying to call Matlab functions form C++ code. With Matlab it comes an example of such code at /extern/examples/eng_mat/engdemo.cpp, however I found no way to build that source code. Here is the makefile I use: CFLAGS = -Wall -O3 INCLUDES = -I/opt/Matlab-2009a/extern/include LIBRARIES = -Wl,-R/opt/Matlab-2009a/bin/glnx86 -L/opt...

C++ programming for HTTPS

Hi, I am a C++ programmer new to HTTPS. I need to write a COM based windows service in C++ which can handle HTTPS requests. But for that I would need to understand how the technologies and protocol fit together. I understand this is a very open ended question but my intent is to find some documentation that introduces a C++ programmer ...

C++ desktop applications framework

I am not new to c++,but i have not found a c++ desktop applications framework.I have found one and it seems to complex.Are there other frameworks available for c++ out there?. ...

Removing fills in SWF files

Hi, guys! I believe I have a different problem. We have some dozens of SWF files and we need remove a certain fill of each SWF file, to each frame! That fill is purple color and it should help, but we aren't SWF experts. What we want is developing a tool (in Delphi, C++ or any language) able to read each SWF file and modify it, generat...

c++ const member function question

I am reading a book called 'Effective C++, Second Edition' and its talking about const member functions and how you have bitwise const-ness and conceptual const-ness. It says most compilers will go with bitwise const-ness, which is that you cannot alter data members of an object inside a const member function. Then there's an example o...

To use or not to use C++0x features

Possible Duplicate: How are you using C++0x today? I'm working with a team on a fairly new system. We're talking about migrating to MSVC 2010 and we've already migrated to GCC 4.5. These are the only compilers we're using and we have no plans to port our code to different compilers any time soon. I suggested that after we do ...

Flexible logger class using standard streams in C++

Hi all, i would like to create a flexible logger class. I want it to be able to output data to a file or to standard output. Also, i want to use streams. The class should look something like: class Logger { private: std::ostream m_out; // or ofstream, iostream? i don't know public: void useFile( std::string fname); void useSt...

Multiple animation at a time

I'm making a Asteroids game but I can not get to play more than one explosion at a time. Just get to do one at a time ... This is my code I call in the main loop: for(i = 0; i < MAX_SHOTS; i++) { for(j = 0; j < MAX_ASTEROIDS; j++) { if(shot[i].CheckCollision(asteroide[j])) { shot[i].SetPos(-100, 0); ...

Binding arguments to signals/slots

Hi guys .. I basically have multiple events signals which I want to connect to the same slot. What I want to know is how can I pass string based paramters to that same slot so that the slot knows which is this signal coming from. One alternative is to make as many slots as there are signals and then connect them in a 1:1 manner, but this...

Eclipse C++ (CDT) and build target directories

I have a problem to find where I change the build directory for my Eclipse (Helios) C++ project. It has a fairly simple structure; MyProject/ MyProject/src MyProject/headers MyProject/data/ MyProject/data/common MyProject/data/debug MyProject/data/release MyProject/target MyProject/target/debug MyProject/target/elease As you've proba...

c++ STL queues, references and segmentation fault

Newbie to C++ learning by converting a java program to c++. The following code results in a segmentation fault (SIGSEGV) when executed. //add web page reference to pages queue (STL) void CrawlerQueue::addWebPage(WebPage & webpage) { pagesBuffer.push(webpage); } //remove and return web page reference from pages queue WebPage & Crawl...

Is it worth learning Eclipse for C++ development

As far as I know it is hard to learn using Eclipse from scratch. But I will get such benefits as fast source code browsing, call graphs, static code analysis. What other benefits will I get from using Eclipse for C++ (CDT)? ...

Win7 Drag&Drop: Possible to find out if COleDataObject contains shell library?

I have an application with a file and folder list control which supports Drag&Drop operations. Now I would like to make it possible for the user to be able to drop a Windows 7 Library (e.g. Music, Pictures and so on) into this control. In my drop handler I have a COleDataObject and now I'm trying to find out, if a library has been dropp...

c++: Call derrived function from base constructor?

Possible Duplicate: Calling virtual functions inside constructors class Base { virtual void method() { cout << "Run by the base."; }; public: Base() { method(); }; }; class Derived: public Base { void method() { cout << "Run by the derived."; }; }; void main() { Derived...