Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing Custom ActiveX DLL Events
Message
De
19/12/1997 01:00:18
 
 
À
19/12/1997 00:21:18
Jay Shepherd
Construction DataFax, Inc.
Montevallo, Alabama, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00066798
Message ID:
00067132
Vues:
41
>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
Fil
Voir

Click here to load this message in the networking platform