Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Reference To Project
Message
From
15/12/2006 20:38:56
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
15/12/2006 18:27:40
Tolga Kaya
Not Applicable
Namur, Belgium
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01178122
Message ID:
01178229
Views:
22
>Actually I have a problem with an Active-X object. On the intellisense side, everything works fine.
>
>I have an Active-X object which consist of 1 visual ( which we can add to form ) and 18 none visual ( which we can reference )classes.
>I have no problem with addin visual class to form. BUT to manipulate this visual object I have to create a reference object to one of its non visual sub classes.
>My problem starts here. When I use CREATEOBJECT() I get OLE Error 1426 .Library Not Registered.
>The author of this Active-X object asked me if referencing like VB6, exists in VFP9.
>As far as I know, like you told me, we don't have any other referencing way.

I've had a problem like that, and actually the author of the control found the solution, using the GetInterface() function. He learned that much VFP while we were trying to solve this. Syntax was like this:
oIntfRef=GETINTERFACE(this.object.interfaceName, "{its GUID}", "its.ocx")
These other interfaces weren't properly declared when building the OCX, but they worked in VB6, .net and few others which don't require full declaration and can take some shortcuts. Without this workaround, I was able to see these other interfaces in the object browser, in intellisense (in both command window, code editing windows and in the debugger), but none of their properties would pop up, I kept getting the "not implemented".

Actually, if the error you're getting is "not registered" on the main class - there's a glitch in the OCX mechanism, so when it's instantiated via CreateObject(), it assumes it's created for editing from runtime, for which it usually doesn't have a license. The workaround is to create an OleContainer class which would have that particular OLE control as its OLE Class, and then instantiate this OleContainer each time you need the ActiveX control instantiated. It's just a wrapper (and the reason why every once in a while regular syntax won't work, you need to use the this.object.something instead of this.something. The bit of the code above is taken from one such oleContainer.

back to same old

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

Click here to load this message in the networking platform