Information générale
Catégorie:
Codage, syntaxe et commandes
>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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement