#Help with DLL's!!!!!
05-Oct-91 03:56:26
Sb: #1406-#Help with DLL's!!!!!
Fm: Vincent Chen 76636,415
To: John Ruzicka 75160,2376
John,
Apparently, without the Controls Development Kit (CDK), the DLL function
cannot return a string as the function return value, but you can return strings
through the function's arguments. That is:
int FAR PASCAL _export foo (LPSTR s)
{
lstrcpy(s, "Returned string");
return 0;
}
In VBasic:
Declare Function foo Lib "foolib" (ByVal s As String) As Integer
The LPSTR is defined in WINDOWS.H as far char *
lstrcpy is strcpy that works for long char pointers.
I think that's all there is to it. By the way, Petzold's "Programming
Windows" book recommends *not* using "compact" or "large" model.
-vince
There is 1 Reply.