DLL __cdecl doesnt seem to work?
I am currently having problems with a DLL, the DLL will work fine in C++ however I am trying to make the DLL portable with VB so that my friends can use the DLL's made in C++ when they just need the power that VB cannot assign. Currently I am working with a Dynamic Linked Library, not Static. Im using the __declspec(dllexport) definition. I checked MSDN and they said that VB always uses __cdecl for API calling convention. However the DLL will run just fine in VB until the DLL has to return a value, then it all just crashes and the DLL doesnt get shut down etc.. I have tried adding the compile option Gd, and Gz (both seperate compiles ofcourse) and VB still gives the "Bad DLL Calling Convention" error, I am not quite sure what I am doing wrong in the DLL, here is a sample of what Im putting in the header file:
It's just a silly sample DLL that i've been working with to try to get it working with VB properly. "void" functions work perfectly, its when they have to return a value when it doesnt work properly.
#define EXPORT extern "C" __declspec (dllexport)
#define EXPORT __declspec (dllexport)
EXPORT int TestB(char *Say);