I've been using the Concurrency Runtime in a C++ static library, and recently wanted to use this library in a C++/CLI project, to take advantage of the Windows Form designer and avoid MFC. Unfortunately, the Concurrency Runtime is not compatible with the /clr switch required in C++/CLI. I tried surrounding the included header files that use the Concurrency Runtime in the "#pragma unmanaged ... #pragma managed" directives, but while that's worked for me with other code in the past, it doesn't seem to work in this case. By which I mean that I get the error:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\concrt.h(27): fatal error C1189: #error : ERROR: Concurrency Runtime is not supported when compiling /clr.
I'm not super well versed in mixing managed and unmanaged code, so it's possible that there's a work-around that I'm not aware of. But on the other hand, perhaps this is just a silly approach. If it weren't for the fact that I find MFC impossibly complex, and the Form designer so nice and easy, I'd just do pure C++. With a preference to mixing the two, any suggestions?