Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing CStrings in DLLs from VP5
Message
De
09/04/1998 22:08:10
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00090588
Message ID:
00090967
Vues:
29
I tested a very simple dll function that returns CString and is declared as export "C". The VC++ compiler generates a warning: "'ExportedFunction' has C-linkage specified, but returns UDT 'CString' which is incompatible with C".

As you already said, the call of this function (from VFP) crashes VFP. Anyway, I really don't see how the conversion would be done. CString is a class, and C is not OO.

Vlad

>I've never written a C++ DLL routine that returns a string. Most of the time I pass a string reference to the DLL, so I can let VFP preallocate the buffer, but I'd guess that it isn't really a problem if you just assign a CString return value into the VPF memvar, I might just have to test this later.
>
>But I know that my VFP Ole server returns a VFP string and the C++ code recieves it as a CString. VC++ seems pretty good at casting CStrings in and out.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform