Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to pass char * from a dll to VFP5
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
How to pass char * from a dll to VFP5
Miscellaneous
Thread ID:
00125064
Message ID:
00125064
Views:
65
I have to pass CStrings to VFP5 from a regular MFC DLL.

The DLL program need to use CStrings CStrings can not be passed to VFP Therefore, I convert them to char* like I am showing below: ( I am including just the basic lines )
in C++:
the function is like:
extern "C" __declspec(dllexport) int cname(char *pCname)
{
CString Cname( "long test now ");
pCname= new char[Cname.GetLength()+1];
strcpy(pCname,Cname);

return 0; // based on previous operations Ok/not
}

in VF5

DECLARE INTEGER Cname IN "xxx.dll" STRING @ NAMES

this does not seem to work for me.

Is there a proper way to do this ?

Thanks
David
Next
Reply
Map
View

Click here to load this message in the networking platform