General information
Category:
Windows API functions
Title:
How to pass char * from a dll to VFP5
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only