Sign in to follow this  
floatingwoods

SwitchToFiber crashes when called after AFX_MANAGE_STATE(AfxGetStaticModuleState())

Recommended Posts

floatingwoods    364
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this