Multiple instances of a VBX 
Author Message
 Multiple instances of a VBX


>How do you differentiate between different instances of a VBX?
>When multiple instances of a control are created, the same HCTL value
>is always passed to the main control procedure for all messages.  The
>HCTL value is used to generate events with the VBFireEvent function.
>So, without a unique HCTL value, how do I generate the events in the
>correct instance of the control?  

This doesn't sound right.  You should be able to use a combination
of the htcl and the hwnd to determine exactly which control and window
you are using.  In other words, the htcl is a unique identifier.

>I have created a winsock VBX (with VC++ 1.5) and if multiple
>applications using the VBX are opened, all events generated within the
>VBX are passed to the last created instance.  

Don't forget that the VBX is shared by all controls using it.  In other words,
if you have any variables declared globally, then all instances are going
to use the info.  How are you referencing your hctl?

>Also, are there any good references for creating VBX's, OCX's, or
>converting VBX's to OCX's?

See OLE Inside out by Mark Denning (I think).  I found it *very* confusing.
I'm no expert at OLE and to be honest, it initially confused the hell out of me.
I'll go back to it in a month or so when I gather enough guts...


Sat, 15 Aug 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Multiple Instances or Single Instances

2. Multiple Session IDs when creating multiple instances

3. VBX instances - HCTL values

4. Stop Multiple Instances Of Program

5. Graham Mandeno's code to prevent multiple instances

6. Prevent Multiple Instances?

7. Multiple non-default instances of a report

8. Access97: Controlling multiple instances of a subreport

9. Multiple Instances Over a Network

10. Multiple Instances of a form

11. Multiple report instances

12. Are Multiple Instances for reports possible?


Powered by phpBB® Forum Software