CWinthread
-
I would really like to use CWinThread class. I have an odd situation where i am in a dll and would like to use a thread. For come reason CWinThread is not accessible here. When i try to inclde afxwin.h before my stdafx.h I would not compile on : CWinThread *pThread; I get the following errors error C2143: syntax error: missing ';' before'*' error C2501: 'CWinThread':missing storage-class or type specifiers. Any idea what is going on here?
-
I would really like to use CWinThread class. I have an odd situation where i am in a dll and would like to use a thread. For come reason CWinThread is not accessible here. When i try to inclde afxwin.h before my stdafx.h I would not compile on : CWinThread *pThread; I get the following errors error C2143: syntax error: missing ';' before'*' error C2501: 'CWinThread':missing storage-class or type specifiers. Any idea what is going on here?
-
I would really like to use CWinThread class. I have an odd situation where i am in a dll and would like to use a thread. For come reason CWinThread is not accessible here. When i try to inclde afxwin.h before my stdafx.h I would not compile on : CWinThread *pThread; I get the following errors error C2143: syntax error: missing ';' before'*' error C2501: 'CWinThread':missing storage-class or type specifiers. Any idea what is going on here?
Why not include afxwin.h IN stdafx.h? Build a quick temporary MFC project with the project wizard and you'll see a working arrangement for the MFC header files. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Why not include afxwin.h IN stdafx.h? Build a quick temporary MFC project with the project wizard and you'll see a working arrangement for the MFC header files. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Have the same problem if i include afxwin.h IN stdafx.h Could it be that my .dll is a win32 and cannot run MFC classes?
-
How would i get around this using a Win32 dll trying to implement an MFC class like CwinThread? If this is not possible, what are my thread options. I am simply creating a waitable timer but wanted to do this in a thread. thanks,
If all you are using is CWinThread from MFC, then you really don't need the entire MFC library. Just use what's appropriate for a given module: Module uses Use this to create a thread ------------ ------------------------------- MFC: CWinThread CRT (no mMFC): _beginthread()/_beginthreadex() No CRT or MFC: CreateThread() Windows API Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Have the same problem if i include afxwin.h IN stdafx.h Could it be that my .dll is a win32 and cannot run MFC classes?
An MFC DLL is a Win32 DLL. Getting it to compile has nothing to do with the type of DLL. The MFC header file(s) and/or Windows SDK header files need to be included in a certain order. Again, if you need to know for sure how to order the includes correctly, create a temporary MFC project with the wizard and copy the way stdafx.h is layed out. It's better than trying to guess. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: