Click here to Skip to main content
15,908,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Link Errors from Imports/Exports with C++ prog importing C exports Pin
ForNow25-Jan-08 10:53
ForNow25-Jan-08 10:53 
GeneralGDI+ RectF constructor Pin
bob1697224-Jan-08 9:34
bob1697224-Jan-08 9:34 
GeneralRe: GDI+ RectF constructor Pin
Mark Salsbery24-Jan-08 9:41
Mark Salsbery24-Jan-08 9:41 
GeneralRe: GDI+ RectF constructor Pin
bob1697224-Jan-08 9:57
bob1697224-Jan-08 9:57 
GeneralRe: GDI+ RectF constructor Pin
bob1697224-Jan-08 9:59
bob1697224-Jan-08 9:59 
GeneralRe: GDI+ RectF constructor Pin
Mark Salsbery24-Jan-08 10:01
Mark Salsbery24-Jan-08 10:01 
GeneralRe: GDI+ RectF constructor Pin
bob1697224-Jan-08 10:08
bob1697224-Jan-08 10:08 
QuestionAFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Wes Jones24-Jan-08 9:09
Wes Jones24-Jan-08 9:09 
Hi All,

I am looking some code in a dll which is part of a project I inherited & see the following code in a CWinThread derived class:
<br />
BOOL CMyThread::InitInstance()<br />
{<br />
    AfxEnableControlContainer();<br />
    AfxOleInit();<br />
<br />
    CoInitialize(NULL);<br />
<br />
    AFX_MANAGE_STATE(AfxGetStaticModuleState());<br />
<br />
    //..other stuff starts here<br />
    return TRUE;<br />
}<br />


Is it me, or does AFX_MANAGE_STATE() not belong here? The thread is instantiated from other plaes in code where AFX_MANAGE_STATE has already been called & there is no cross-thread communication w/ other threads or the calling process.
Is it common practice to call AFX_MANAGE_STATE from a CWinThread derived class's InitInstance() ?

Also, does it matter if I call CoInitialize/CoInitializeEx before calls to AfxEnableControlContainer()/AfxOleInit()?
Thanks!
AnswerRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
David Crow24-Jan-08 9:22
David Crow24-Jan-08 9:22 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Wes Jones24-Jan-08 9:41
Wes Jones24-Jan-08 9:41 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
David Crow24-Jan-08 9:45
David Crow24-Jan-08 9:45 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Wes Jones24-Jan-08 11:05
Wes Jones24-Jan-08 11:05 
AnswerRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Mark Salsbery24-Jan-08 9:52
Mark Salsbery24-Jan-08 9:52 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
led mike24-Jan-08 10:19
led mike24-Jan-08 10:19 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Mark Salsbery24-Jan-08 10:26
Mark Salsbery24-Jan-08 10:26 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
led mike24-Jan-08 10:52
led mike24-Jan-08 10:52 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Mark Salsbery24-Jan-08 11:01
Mark Salsbery24-Jan-08 11:01 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Wes Jones24-Jan-08 10:40
Wes Jones24-Jan-08 10:40 
GeneralRe: AFX_MANAGE_STATE in CMyThread::InitInstance()? Pin
Mark Salsbery24-Jan-08 10:43
Mark Salsbery24-Jan-08 10:43 
General16-24 Bit image issue for MFC Pin
sunny.rana24-Jan-08 7:05
sunny.rana24-Jan-08 7:05 
GeneralRe: 16-24 Bit image issue for MFC Pin
Mark Salsbery24-Jan-08 7:28
Mark Salsbery24-Jan-08 7:28 
GeneralRe: 16-24 Bit image issue for MFC Pin
sunny.rana25-Jan-08 9:39
sunny.rana25-Jan-08 9:39 
GeneralRe: 16-24 Bit image issue for MFC Pin
Mark Salsbery27-Jan-08 7:06
Mark Salsbery27-Jan-08 7:06 
GeneralDialog Displays Differently Pin
Reagan Conservative24-Jan-08 6:47
Reagan Conservative24-Jan-08 6:47 
QuestionRe: Dialog Displays Differently Pin
David Crow24-Jan-08 7:31
David Crow24-Jan-08 7:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.