-
C++ Builder DLL
I cant get a simple C++ Builder DLL to return a string into Visual Basic
The C++ Builder DLL Function Code is this:
extern "C" __declspec (dllexport) __stdcall char* ReturnHello()
{
char* NewString = "hEllo WoRLd!";
return NewString;
}
the VB side is:
Private Declare Function ReturnHello Lib "mylib" () As String
private sub form_load()
msgbox retunrHello
end sub
it keeps coming up with error 96, conflicting type modifiers, Help, please, someone.....
ICQ# 96929314
:confused: :(
-
Look at the other Strings and DLLs thread - it's not specific to C++ Builder but it gives you enough of an idea. You shouldn't really return pointers to local variables (although in this case it MIGHT work because it's a static string).