Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String vs Character Type in COM Object
Message
From
22/02/2011 15:47:04
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01501310
Message ID:
01501319
Views:
44
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform