Boost logo

Boost Users :

From: Greg Kogut (gkogut_at_[hidden])
Date: 2005-07-07 12:05:26


Hi,

I've created a very simple threading program, basically a modification of one of the boost
examples.

I've successfully compiled and run the program in both Linux and Windows.

My next step was to embed the code in a Windows MFC DLL. Again, very simply. A few lines of
code.

The DLL compiles correctly. However, MFC's AfxLoadLibrary returns FALSE when I try to load the
library.

Some source code:

        axisGrabThreadBody grabber(&myimage); //a structure containing code to put in thread
        boost::thread grab(grabber); //create the boost thread
        grab.join(); //bind the thread

The above fails when trying to load via AfxLoadLibrary. This is before the code is run. It's
just when trying to dynamically load at runtime.

However:
AFX_MANAGE_STATE(AfxGetStaticModuleState());
        axisGrabThreadBody grabber(&myimage); //a structure containing code to put in thread
        //boost::thread grab(grabber); //create the boost thread
        //grab.join(); //bind the thread

Now AfxLoadLibrary correctly loads the DLL. Why is this? Again, the code is not being run.

I'm using the latest stable release of Boost, and running Windows XP. Using VC++ 7. Vastly prefer
gcc and Emacs to VC++ 7.

Any ideas?

Thanks,
Greg


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net