Boost logo

Boost :

Subject: [boost] Fwd: [Thread] Solution to conflict with MFC?
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2011-04-27 08:30:38

Hi Thread maintainers,

Anthony speaks about a patch to make this work. Does anyone know where
it is? And could it be applied?



-------- Original Meddelelse --------
Subject: [Thread] Solution to conflict with MFC?
Date: Tue, 26 Apr 2011 13:28:56 +0200
From: Christian Larsen <contact_at_[hidden]>
Reply-To: boost-users_at_[hidden]
To: boost-users_at_[hidden]
Newsgroups: gmane.comp.lib.boost.user


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., 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, 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 list run by bdawes at, gregod at, cpdaniel at, john at