Sign in to follow this  
kuharh

Multi-threaded

Recommended Posts

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 this post


Link to post
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 this post


Link to post
Share on other sites
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 this post


Link to post
Share on other sites
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 this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this