I want to integrate C# user control in an ˇ°classicalˇ± MFC application. The whole project contains one .EXE and many .DLLs with objects used by the .EXE.
When DLLs are compiled, object are declared with ˇ°_declspec(dllexport)ˇ±.
When objects are used in .EXE, the are declared with ˇ°_declspec(dllimport)ˇ±.
I have added the /CLR option only in the .EXE (DLLs have only ˇ°business objectsˇ±). And when I compile the solution, I have the following error:
Error LNK2028: unresolved token (0A0001A5) ˇ°public int __thiscall CXXX:Xxxx() ˇ..ˇ±
When I compiled the solution without the /CLR option, all is good.
The help on this error explains that in native, the calling convention is ˇ°__cdeclˇ± and in /clr:pure it is ˇ°__clrcallˇ±. But IˇŻm not in /clr!pure, I use only the /CLR option.
Any idea on how to solve this problem Unfortunately, I cannot add the /CLR option in all DLLs because I have a lot of errors (it will be a hard work).
Thanks for your help
Francois