Multi-threaded

Started by
6 comments, last by anonuser 19 years, 2 months ago
When I switched from single-threaded debug to multi-threaded debug in Visual studio .net and ran my application it would not quit. Instead it would stop executing but a tab remained as if it where minimized. I changed the following line and it works correctly now but do not know why. INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, INT) to int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, INT) Any info would be appreciated, I am in the process of learning how to develop multi-threaded windows apps.
Advertisement
Unfortunately, I can't answer your question. Sorry.

I just have one of my own. What does the APIENTRY convention declarator do? I've seen it a million times, even in tutorials where they tell you to use WINAPI. But I have yet to see any explanation for why it is used, and what it does.
I would think it has something to do with the callbacks; along the same lines of what you would do to export a function out of a DLL? I'm not exactly sure either; would be nice to know though!
-John "bKT" Bellone [homepage] [[email=j.bellone@flipsidesoftware.com]email[/email]]
Hmmm... That's pretty strange. If you check your windef.h file you will see that the definitions for WINAPI and APIENTRY are the same:
#define WINAPI __stdcall//...#define APIENTRY __stdcall
In the file windef.h APIENTRY and WINAPI are defined like this:
#define WINAPI      __stdcall#define APIENTRY    WINAPI 
So, changing from WINAPI to APIENTRY does nothing.

Also in the file windef.h, INT is defined like this:
typedef int                 INT; 
So, changing from INT to int also does nothing.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Are you sure the windef.h file is being accessed before some other definition of the terms?
It must have been some coincidence. Anyway the app works now and I noticed that if I hover the mouse over APIENTRY that it says #define APIENTRY WINAPI.
VC++ is already multithreaded debug its a matter of stepping into those threads.

Step out of loops and the main function to get to the next thread.

Or put a break in a thread. Other than that I've no idea, i've done lots of thread debuggin in VS and that's how I do it. Step Out and step in to threads.

This topic is closed to new replies.

Advertisement