$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] [Thread] Solution to conflict with MFC?
From: Daniel Bradburn (moagstar_at_[hidden])
Date: 2011-04-27 11:40:10
I'm not sure how restrictive this would be for you but perhaps you could try
statically linking the runtime and mfc libraries rather than dynamically
linking them?
2011/4/27 Christian Larsen <contact_at_[hidden]>
> Den 27-04-2011 08:18, Daniel Bradburn skrev:
>
>  If you are linking boost thread statically, are you also linking MFC
>> and the C runtime statically?
>>
>
> No, I link dynamically to MFC and the C runtime. I use Visual Studio 2008
> with SP1, and Boost version 1.45.0 (but tss_pe.cpp has not changed in 1.46.1
> it appears).
>
> Best regards,
> Christian
>
>  2011/4/26 Christian Larsen <contact_at_[hidden] <mailto:contact_at_[hidden]>>
>>
>>
>>    Hello,
>>
>>    I know this has been asked before, but I could not find a good
>>    solution. I'm experiencing problems with an application using both
>>    MFC and Boost.Thread. Specifically the assertion
>>
>>    ASSERT(AfxGetModuleState() != AfxGetAppModuleState());
>>
>>    in AfxCoreInitModule() fails. I link Boost.Thread statically into
>>    a DLL in my project.
>>
>>    >From previous posts to this list and elsewhere, e.g.
>>    http://listarchives.boost.org/boost-users/2009/04/46929.php, I see that
>>    the issue is caused by setting _pRawDllMain in tss_pe.cpp.
>>    Commenting this line does "solve" the problem, but I would rather
>>    not have to hack the Boost source code this way.
>>
>>    It seems there is a patch somewhere for this problem (referred to
>>    in http://listarchives.boost.org/boost-users/2009/04/47015.php), but it
>>    appears it never made it into the source. Is there any chance of
>>    this issue being solved in a better way?
>>
>>    Best regards,
>>    Christian Larsen
>>    _______________________________________________
>>    Boost-users mailing list
>>    Boost-users_at_[hidden] <mailto:Boost-users_at_[hidden]>
>>
>>    http://listarchives.boost.org/mailman/listinfo.cgi/boost-users
>>
>>
>>
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://listarchives.boost.org/mailman/listinfo.cgi/boost-users
>>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://listarchives.boost.org/mailman/listinfo.cgi/boost-users
>