Boost logo

Boost Users :

Subject: Re: [Boost-users] Who can give me a sample for how to using boost::thread in a MFC regular dll?
From: DDGG (ddcatgg_at_[hidden])
Date: 2010-04-19 11:24:29


Thanks for your help, but it is no way...
I have placed my sample project to:
http://ddgg.50webs.com/TestBoostThreadDll.rar

World you like to help me? Thanks a lot!

2010/4/19 Ismael Bejarano <ismaelbej_at_[hidden]>:
> Hi,
>
> On Sun, Apr 18, 2010 at 2:18 PM, DDGG <ddcatgg_at_[hidden]> wrote:
>> Hello everyone!
>>
>> I have a MFC application that using boost::thread, it runs well.
>> Now I wrapped it to a MFC regular dll, but I get a assertion error
>> when I using this dll.
>>
>> // (In my another MFC dialog application)
>> void AFXAPI AfxCoreInitModule()
>> {
>>   ASSERT(AfxGetModuleState() != AfxGetAppModuleState()); // assertion error
>>   // the return value of AfxGetModuleState() and
>> AfxGetAppModuleState() are both not-empty,
>>   // but they are different.
>> ...
>> }
>>
>> Any advice? thanks!
>>
>
> Try adding at the begining of each exported function this line
> AFX_MANAGE_STATE(AfxGetStaticModuleState());
>
> Cheers,
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net