I want to call a pure C style function from a dll in my C++ program. I tried casting my function pointer using reinterpret_cast to __cdecl and still the calling convention of _stdcall seems to be preserved. I am new to Windows C++ programming.
Edit Code from comment
reinterpret_cast< Error ( __cdecl*)(int,int)> (GetProcAddress(Mydll::GetInstance()->ReturnDLLInstance(), "add"))(1,10)
is my call. The actual function syntax seems to have been declared as
Error __cdecl add(int,int);
Debugger throws me the error run time check failure #0. I am working in Windows-C++
This helped me out!
http://www.codeguru.com/forum/archive/index.php/t-70673.html