Actually, I have successfully used Casablanca within an MFC application. Yes, there is a problem with the two systems in one application. I can’t prove it, but I think has to with the memory models and those models as used in threads. It has something to do with the fact MFC and strict Win32 windows are incompatible. As we who build MFC apps know that windows.h and afx headers are incompatible at compile time and the different libs are incompatible at link time.
The work around is this. You have to combine the two at run time. Put all of the Casablanca code and libs into a dll with an interface that you can use to accomplish whatever it is that you need to do and load that dll using the LoadLibrary command. You can extract all the functions at run time and call them. If you try to link the dll at link time using a .lib you will fail.
If there is sufficient desire I can point you to some code examples of loading dlls at runtime.
One thing, passing data across the dll boundary and the main thread can be dicey. Data transfer is somewhat limited. Pointers in the separate threads are sometimes not valid in the other (segmentation fault). If you pass in a pointer and and you expect to write to the location pointed to, you will have problems.You will not be able to pass Casablanca datatypes into the main thread, nor MFC types the other way. You have to use data types know in both worlds.
Paul
The work around is this. You have to combine the two at run time. Put all of the Casablanca code and libs into a dll with an interface that you can use to accomplish whatever it is that you need to do and load that dll using the LoadLibrary command. You can extract all the functions at run time and call them. If you try to link the dll at link time using a .lib you will fail.
If there is sufficient desire I can point you to some code examples of loading dlls at runtime.
One thing, passing data across the dll boundary and the main thread can be dicey. Data transfer is somewhat limited. Pointers in the separate threads are sometimes not valid in the other (segmentation fault). If you pass in a pointer and and you expect to write to the location pointed to, you will have problems.You will not be able to pass Casablanca datatypes into the main thread, nor MFC types the other way. You have to use data types know in both worlds.
Paul