Results 1 to 3 of 3

Thread: ActiveX Multiple instances

  1. #1

    Thread Starter
    Registered User
    Join Date
    Oct 2004
    Location
    There or there abouts
    Posts
    1

    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

  2. #2
    Lively Member
    Join Date
    Sep 2004
    Posts
    74

    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.

  3. #3
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    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
  •  



Click Here to Expand Forum to Full Width