Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing Custom ActiveX DLL Events
Message
From
19/12/1997 00:53:18
 
 
To
19/12/1997 00:21:18
Jay Shepherd
Construction DataFax, Inc.
Montevallo, Alabama, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00066798
Message ID:
00067131
Views:
46
>Yes, my code is still giving the OLE error... something about 'Interface not supported' or something like that.

Do you have an error code also? Did you try the SYS(2333) VFP function?

>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).

Correct. Only that it's not enough for you... :)

>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.

AFAIK, you cannot "trap" an event in VFP. Instead, you must subclass the control. You do this using an OleControl. Now, don't ask me why you cannot use your subclass without a form. :) But this shouldn't matter too much as long as you don't need to make the form visible or to activate it. So, you can use it like a useless container that allows you to use your subclass in a program.

Only if you would bypass the OLE error... :) Can you use your VB component in VB? I mean: did you test it in VB?

Vlad
Previous
Reply
Map
View

Click here to load this message in the networking platform