Original Post
OK... simple Windows Forms app. However, simply by including , I get a string of C3641 errors:
Of course, if I set the properties of the project to /clr (without pure or safe), it compiles just fine but blows up at run time error right at the outset with an assert citing something amiss in "debugheap.c"...
The code in dbgheap.c that the assert is on is:
(Kudos to MS for using "totally bogus" in a comment.)
The call stack at this point doesn't seem to help. Again, this is at run-time before the code even enters the main{} function. This error goes away once I comment out the include of the ATLComTime again. That is, the rest of the code doesn't mind having /clr in effect (without 'pure').
My question is... which of these two should I be trying to fix and how? Is it not permissible to use ATLComTime (and the COleDateTime functions it holds) with Windows Forms? Alternately, why can't I run code in /clr mode without ATLComTime throwing up this "totally bogus" pointer?
Thoughts?
Quote:
Error 1 error C3641: 'InterlockedExchangePointer' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
Error 2 error C3641: 'ATL::_AtlGetConversionACP' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
Error 3 error C3641: 'AtlA2WHelper' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
Error 7 error C3641: 'AtlDevModeW2A' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
Error 8 error C2440: 'default argument' : cannot convert from 'int (__cdecl *)(int,const char *,int,const char *,const char *,...)' to 'ATL::CTrace::fnCrtDbgReport_t'C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atltrace.h 146
Error 9 fatal error C1903: unable to recover from previous error(s); stopping compilation C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atltrace.h 146
Of course, if I set the properties of the project to /clr (without pure or safe), it compiles just fine but blows up at run time error right at the outset with an assert citing something amiss in "debugheap.c"...
Quote:
Expression: _CrtIsValidHeapPointer(pUserData)
The code in dbgheap.c that the assert is on is:
/* * If this ASSERT fails, a bad pointer has been passed in. It may be * totally bogus, or it may have been allocated from another heap. * The pointer MUST come from the 'local' heap. */ _ASSERTE(_CrtIsValidHeapPointer(pUserData));(Kudos to MS for using "totally bogus" in a comment.)
The call stack at this point doesn't seem to help. Again, this is at run-time before the code even enters the main{} function. This error goes away once I comment out the include of the ATLComTime again. That is, the rest of the code doesn't mind having /clr in effect (without 'pure').
My question is... which of these two should I be trying to fix and how? Is it not permissible to use ATLComTime (and the COleDateTime functions it holds) with Windows Forms? Alternately, why can't I run code in /clr mode without ATLComTime throwing up this "totally bogus" pointer?
Thoughts?