Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to pass char * from a dll to VFP5
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
How to pass char * from a dll to VFP5
Divers
Thread ID:
00125064
Message ID:
00125064
Vues:
64
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
Fil
Voir

Click here to load this message in the networking platform