## Recommended Posts

kuharh    122
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.

##### Share on other sites
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.

##### Share on other sites
bkt    178
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!

##### Share on other sites
Sure Shot    140
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

##### Share on other sites
JohnBolton    1372
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.

##### Share on other sites
Whirlwind    134
Are you sure the windef.h file is being accessed before some other definition of the terms?

##### Share on other sites
kuharh    122
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.

##### Share on other sites
anonuser    148
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.

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account