|
-
Jul 28th, 2001, 11:44 PM
#1
Thread Starter
New Member
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
-
Jul 29th, 2001, 06:38 AM
#2
Monday Morning Lunatic
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).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|