|
-
Oct 27th, 2004, 09:47 AM
#1
Thread Starter
Registered User
ActiveX Multiple instances
Hi All,
I am developing an ActiveX at the mo. What I would like to be able to do is when the activex is placed on to a form (probably in UserControl_Initialize() function) is to determine if there is another instance of this activeX on the form already. If there is then I can expose some properties/methods for communicating between the two.
Any thoughts? Is this possible?
Cheers
-
Oct 27th, 2004, 12:55 PM
#2
Lively Member
Re: ActiveX Multiple instances
Originally posted by Sulman1
Hi All,
I am developing an ActiveX at the mo. What I would like to be able to do is when the activex is placed on to a form (probably in UserControl_Initialize() function) is to determine if there is another instance of this activeX on the form already. If there is then I can expose some properties/methods for communicating between the two.
Any thoughts? Is this possible?
Cheers
Possible?, probably yes,
adviseble> NO, most likely to end in an infinite loop between the 2 component's.
Add an function to the form to check if more than one exists and handle the communication between the component's there.
I even think it goes against the rules of ActiveX to incorparate such an function in an ActiveX component.
-
Oct 29th, 2004, 02:58 PM
#3
Re: ActiveX Multiple instances
Originally posted by Sulman1
Hi All,
I am developing an ActiveX at the mo. What I would like to be able to do is when the activex is placed on to a form (probably in UserControl_Initialize() function) is to determine if there is another instance of this activeX on the form already. If there is then I can expose some properties/methods for communicating between the two.
Any thoughts? Is this possible?
Cheers
Yes. Each could hold a reference to another VB6 object, called a Singleton. There is only one instance of the Singleton, and many clients can all hold a reference to the same object.
I go into it in some detail here:
http://www.vbforums.com/showthread.p...ight=Singleton
Go to the very last post of mine and check out the SimulBrowse Singleton.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|