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 Chriss Miller 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
Joined
Jul 8, 2002
Messages
35
Location
US
[Note: seems like I was unable to post this a few minutes ago. Sorry if it gets duplicated]

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?
 
FYI,

I found the answer to the problem.

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 VC++, I had to include the User32.LIB at compile time, and everything went fine.

Thanks,


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top