Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
String vs Character Type in COM Object
Message
De
22/02/2011 15:47:04
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01501310
Message ID:
01501319
Vues:
45
If the contract declares it returns a String, it should be a String. That's what any client will be expecting from the COM server.

Returning a pointer is dangerous because then you have shared memory, which can lead to nasty issues.


>Hi
>
>I have created a VFP MT COM dll which has one method:
>
>ParseResponse(tcTxt As String) As String
>
>Now I want to know the difference between declaring it as string vs declaring it as character?
>
>When I create the COM object from using CoCreateInstance I get a valid COM object and and call the Release method etc. but when I try to received the return value I get a memory error so I am trying to understand what the VFP COM object is returning. The VFP code just returns a string of up to as many 512 characters. What does COM do to that string and what format is it actually a string or is it just a pointer to a buffer?
>
>Thanks,
>Simon
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform