Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
From VB to VFP
Message
From
14/12/2001 22:13:37
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00594726
Message ID:
00594751
Views:
23
>>>Any difference if you pass the parameter BY REFERENCE?
>>
>>I also tried that. It didn't help.
>
>Try
LOCAL loEClient
>LOCAL lcResponseCode
><b>lcResponseCode = REPLICATE(CHR(0), 255)</b>
>loEClient=CREATEOBJECT('MyObject')
><b>loEClient.GetResponseCode(@lcResponseCode)</b>
>? 'Response Code: ' + lcResponseCode
>
I finally found some documentation about that point. Basically, JScript has the same problem. Those methods will return an empty string as JScript doesn't support in and out (i.e., by reference) arguments with COM objects. So, this is probably the situation we are facing here with Visual FoxPro.

There documentation gives a workaround. However, I'm not sure how I can translate that in Visual FoxPro.
The sample code shows how most of the work can be done with JScript but
when it comes time to retrieve the Get method results from the COM object,
the JScript code must pass the object to a VBScript function
that does the GETs and then returns the results back to the JScript via a
VBArray which is supported by JScript. For example,

//Start JScript
....
oEClient = new ActiveXObject("My object");
....
//Do Sets...
....
VBarray = new VBArray(VBdoTransaction(oEClient));
Jarray = VBarray.toArray();

.... 

//End JScript

< SCRIPT LANGUAGE="VBScript" RUNAT=SERVER>
option explicit

Function VBdoTransaction(oEClient)
Dim vbArray(10)
Dim vbrc
.
.
.

VBdoTransaction = vbArray

End Function
< /SCRIPT>
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform