Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

MFC Application's AfxGetModuleState() Changes after Linking Boost Thread Static Library to My DLL

Open
#391 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp

Research direction

Start by reproducing the MFC application and MFC-based DLL setup described, using the Boost Thread static library with Visual Studio 2010. Inspect AfxGetModuleState() before and after loading the DLL and compare the application and DLL state. Done means identifying and documenting a fix that prevents the host application's module state and global data from changing.

Written by the indexing model from the issue text.

Description

Issue Description:

Background:
I have developed a program that functions as an MFC (Microsoft Foundation Classes) DLL. In this program, I linked the Boost Thread static library to my DLL.

Problem:
Upon loading my DLL into an MFC application, I have noticed an unexpected behavior. The function AfxGetModuleState() within the MFC application undergoes a modification. Specifically, the global app and resource handler data, among other things, seem to transform into data originating from my DLL.

Expected Behavior:
The AfxGetModuleState() function within the MFC application should maintain its standard behavior and not be influenced by the linked Boost Thread static library in my DLL.

Steps to Reproduce:

Create an MFC application.
Link my DLL, which contains the Boost Thread static library, to the application.
Load the DLL within the MFC application.
Observe the change in behavior of AfxGetModuleState() and the unexpected alteration of global data.
Additional Information:

DLL Type: MFC-based
Linked Library: Boost Thread (Static)
MFC Application Type: MFC-based
Environment: Windows
Compiler: vs2010
Boost Library Version: 1.73 and 1.78
Impact:
This issue is causing unexpected behavior in MFC applications when integrating the Boost Thread static library through my MFC DLL. As a result, it is essential to address this issue to ensure the proper functioning of MFC applications using this DLL configuration.

Your assistance is greatly appreciated.

Dominant language
C++
Stars
213
Forks
171
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/thread

All issues in boostorg/thread

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.