General information
Category:
COM/DCOM and OLE Automation
A fellow I worked with a few years ago wrote a C++ COM object to test what was sent to it when we were fruitlessly trying to pass safearray's to COM servers from VFP6. Starting with VFP8, the following code works:
COMServer = CreateObject('something.class')
DIMENSION MyArray as BYTE
MyArray = 1 && Works without this line too
COMARRAY(COMServer,10) && Pass by ref
COMServer.Method(@MyArray)
The test object shows VT_ARRAY of VT_UI1 VT_BYREF
If I leave off the "as BYTE", I get VT_ARRAY of VT_VARIANT VT_BYREF
If I use:
DIMENSION MyArray as STRING
MyArray = 'A'
I get VT_ARRAY of VT_BSTR VT_BYREF
The "as" clause seems to make a difference.
Gary
>>Hi Sergey, I know this is regurgitation of prior correspondence with you. Got any suggestions on how this can work or is it impossible to return a true String that is a Safe Array?
>>
>>Can you explain why I got the impression from the VFP help file that I can create a Safe Array by using the AS modifier? This is a real stumbling block for me right now and I hope it can be overcome.
>>
>>Hey VFP support team - how about a little help on this one...:>)
>
>Tom,
>
>The 'AS' clause is ignored by VFP code. It's only used to put info about parameter type into COM object type library.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only