Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COM object in VFP
Message
From
25/07/2007 08:24:19
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
25/07/2007 05:19:15
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01243400
Message ID:
01243429
Views:
21
>I try this in VFP but does not works.
>
>PROCEDURE Init [Appl as Variant]
> TopoLKernel = GETINTERFACE(Appl, "ITopoLKernel", "TLKernel.dll")
> RETURN 1
>ENDPROC

Maybe it works, but how would you know unless you watch it in the debugger? The TopoLKernel variable is undeclared, therefore I assumed private to the procedure (.init() of what class?), and destroyed when the procedure exits.

I'd recommend that you create a property of your appl class, and assign the interface object reference to it:
this.TopoLKernel = GETINTERFACE(this, "ITopoLKernel", "TLKernel.dll")
This can as well be in appl.init(), or somewhere later. If this works, the .TopoLKernel property will hold a reference to the interface object. However, I don't think you should pass your appl object as the first parameter - it needs to be a reference to the COM object whose interface you are trying to get.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform