Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoEvents()

Status
Not open for further replies.

scecilia

Programmer
Jul 8, 2002
35
US
Hello,

In VisualC++ I have a program that calls DoEvents() and works just fine.

I moved the exact same code outside VisualC++, since I need it as a stand alone program. However, my DoEvents() now do cause linkage problems. These look like:

void DoEvents(void)
{
MSG msg;
while(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}

DoEvents processes Windows Messages in the message queue. C++ does not have a one command counterpart. What can I do? I need a DoEvents in plain C++! Anyone knows?
 
so do u need the C++ file for use in a separate compiler, or do you just want the executable?

if you only need the executable, open the project folder, and in debug, there's a .exe file. that's the program, which can be moved anywhere.
 
Hello,

FYI, I found the answer:

DoEvents is a function defined in a windows library, VC++ probably just automatically includes the library header, and link the library in when compiling/linking. Outside, you have to figure out which libraries you need to include.

I compiled and included the User32.LIB and everything went fine :)

Thanks,


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top