Jump to content
  • Advertisement
Sign in to follow this  

SwitchToFiber crashes when called after AFX_MANAGE_STATE(AfxGetStaticModuleState())

This topic is 3311 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, My problem might be a little bit complicated to explain: I have an application made-up by 3 parts: (1) The main loop (exe file) (2) A main module (dll file) (3) An extension module (dll file) (1) calls functions of (2) (2) sometimes calls functions of (3) through a callback address provided by (1) which also loaded (3) All functions (or callback functions) of (2) and (3) are protected with: AFX_MANAGE_STATE(AfxGetStaticModuleState()); (2) can create threads or fibers depending on the application settings. At any time, (2) can can call its thread or fiber switching function (SWITCH). That works fine. (3) can also call (2)'s SWITCH function when (2) created regular threads. That also works fine. However when (3) calls the same SWITCH function when (2) created fibers (instead of regular threads), the application crashes. The crash is linked to the AFX_MANAGE_STATE(AfxGetStaticModuleState() instruction (removing it results in no crash), but then I have other problems. Does anyone have a clue about how to solve my problem? Thanks

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!