I have a .NET Class Library that is linking in a static library which has code callbacks defined with __stdcall. On compile I get the warning:
warning C4441: calling convention of '__stdcall ' ignored; '__clrcall ' used instead
How can I correct this is does it not matter

warning C4441: calling convention of '__stdcall ' ignored; '__clrcall ' used instead
ZAP2944
If you had read my post you will have read that I stated where CB_Callback is used to decorate a function I get the C4441 warning; I make no statements about #define causing the problem.
Thank you for the help but give it to someone else -- life is too short to be listening to your sarcasm.
Direct from my code ...
// Calling convention for callbacks
#if
defined(WIN32) || defined(WIN64) #define CB_Callback __stdcall#else
#define CB_Callback
#endif
void* CB_Callback CB_Callback_DoAlloc(unsigned long nSize, const void *pParam);warning C4441: calling convention of '__stdcall ' ignored; '__clrcall ' used instead
BactBob
Rvel
It is a third party static lib so I don't have the luxory of just changing it.
ggssu
As mentioned this is a third party static Lib so I have no control in making changes.
I am also going to be calling a Win32 API that I believe also uses __stdcall so I will be running into the problem there as well.
I am very surprised there is no means of using existing libraries that have a __stdcall calling convention.
KitWest
I have a header file include that contains
// Calling convention for callbacks
#if
defined(WIN32) || defined(WIN64) #define CB_Callback __stdcall#else
#define CB_Callback#endif
Then in my code whereever there is use of CB_CallBack I get the following warning:
Output is:
: warning C4441: calling convention of '__stdcall ' ignored; '__clrcall ' used instead
Fatou
Joleen
>> Then in my code whereever there is use of CB_CallBack I get the following warning: <<
Are you using CB_CallBack on methods of CLI types If so, that's not possible. You can use unmanaged types in a /clr project. Declare your callback functions as methods of the unmanaged class - and use that to interface with the methods in the statically linked library.
Dirty Steve
TA_R_EK
Marc Tomlinson
Brandon K
Shirvo
Stitchy
There isn't any code to show -- these are just functions in a static lib that are native Win32 with calling convention __stdcall.
So how do you mix managed and unmanaged code Isn't there a way of leveraging existing libraries
Manuel Basurto