Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COM Reference, Messaging & Management
Message
 
To
20/06/2001 15:29:24
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00521642
Message ID:
00521677
Views:
13
>I created an App/Custom object and added several child objects to it. I then created a dll/com object and had several issues.
>
>Here are some of those issues I'm trying to find a good method of resolving.
>
>1. I loose the object reference in the 'Watch' window from Parent to Child when looking at a COM objects. I can't see child object properties and methods.
>
>2. I can't use AddObject() method to add FoxPro COM objects to a Parent object.
>
> ie. this doesn't work:
> oApp.CreateObject("Main.Application")
> oApp.AddObject("Registry","Registry.dll") && This Fails - Does Work With COM Objects
> oApp.Registry.OpenKey()
>
>3. COM Objects Loose the ability to share array info. I have tried ComArray() but this doesn't always work and it tends to be very ackward.
>
>Questions:
>
>1. Should I use variables for all COM objects then to try to tie them together
> with parent objects. ie. oApp.Computer.Registry.OpenKey()
> oApp.Computer.IniFile.OpenFile()
>
> Use This Instead:
> Public oRegistry,oIniFile
> oRegistry=CreateObject("Computer.Registry")
> oComputer=CreateObject("Computer.Registry")
> oRegisry.OpenKey()
> oIniFile.OpenFile()
>
>2. Whats the best method of dealing with arrays and COM objects.
>
>3. Has anyone created a program that can read the TypeLib using the FoxTLib.ocx Activex control?

Hi Craig,

I am not sure if I correctly understand what you are trying to do.

If oApp is your client application object, you can use

oApp.oRegistry = CreateObject("Computer.Registry")
oApp.oRegistry.OpenKey()

COMARRAY() is only for passing the arrays to COM objects.
If you want it back, see for example "Get an array from a com object?" Thread#520366

You also may concatenate the array values somehow, and parse it again on the other end.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform