General information
Category:
Coding, syntax & commands
>Yes, my code is still giving the OLE error... something about 'Interface not supported' or something like that.
>
>What I am trying to do, is to be able to trap the events of an ActiveX DLL. The one that I'm working with was created with VB5, but that shouldn't matter. Any ActiveX DLL created with C++, Java, etc, (that has events) should also work.
>
>In the command window, I can instantiate an ActiveX object (that is NOT a control) with:
>
>o=CREATEOBJECT("MyDLL.MyClass")
>
>At that point, o contains an object reference to an instantiated object. I didn't have to worry about forms or controls, etc. o is an object, and has no user interface (though it could).
>
>Now, I can access properties and methods on the object without any trouble. However, let's say that MyClass has a custom event named TestEvent(). Within the object itself (written in VB or C or whatever), something may occur that can raise TestEvent().
>
>In a regular VB app, you can trap this event, and supply code to execute when the event occurs. I'm trying to do the same thing within the VFP environment.
Try the following:
o=createobject("Form")
o.ADDOBJECT("oleObjectExample", "oleClassExample")
o.ADDOBJECT("oleObjectExample1", "OleControl", "dlltest.jtest")
DEFINE CLASS oleClassExample AS OleControl
OleClass ="dlltest.jtest"
ENDDEFINE
Probably you will have the same OLE error on both ADDOBJECT lines, but...
Vlad
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