Information générale
Catégorie:
Fonctions Windows API
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement