Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help! What am I missing?
Message
From
09/01/2001 13:47:26
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00461092
Message ID:
00461339
Views:
17
COM objects does not support array properties. You need to call a method and pass array to it to fill array and return result by such way. If COM object is not in-process, this might cause some difficulties.

>I am unable to get an object created as a com object to support an array.
>What am I doing wrong - or more likely, what is it I don't understand?
>
>Sample 1: Save this code to a prg, add to a project, and build the project as a DLL. Call the dll, e.g., "AComDll"
>
>**** CODE FOR SAMPLE 1 PRG ******
>DEFINE CLASS AnObject AS custom OLEPUBLIC
>DIMENSION AnArray[3,1]
>PROCEDURE AMethod
>store 'John' to this.AnArray
>ENDPROC
>ENDDEFINE
>**** END OF CODE ******
>
>Now run these two lines from the command window to create an instance of the object, and to fire the method:
>
>o = createobject('AComDll.AnObject')
>o.AMethod()
>
>Use debug's "locals" window, and note that o.AnArray is NOT an array.
>
>Sample 2: Save this code to a prg and execute the PRG
>
>**** CODE FOR SAMPLE 2 PRG ******
>clea all
>public o
>o = createobject('AnObject')
>= o.AMethod()
>
>DEFINE CLASS AnObject AS custom
>DIMENSION AnArray[3,1]
>PROCEDURE AMethod
>store 'John' to this.AnArray
>ENDPROC
>ENDDEFINE
>**** END OF CODE ******
>
>Now use debug's "locals" window, and you will see that o.AnArray IS STILL an array.
>
>Any suggestions will be most appreciated!
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform