Results 1 to 11 of 11

Thread: Raise event array

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    18

    Thumbs up

    Hi,
    I`m trying to get a client program to detect events of an array of activex exe's.

    Something like tis doesnt work.

    Dim WithEvents Obj(10) As clsAXE

    Would I have to use a ActiveX Control instead ?

    Thanks

  2. #2
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Thumbs down I wouldn't bother...

    You cannot declare control arrays with events either.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    18

    Angry

    Oh great any solutions ?....... how is it done with other controls ? Because if its "load"ed it will add "Index" within the event ?

  4. #4
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Cool Well

    Controls that are dropped on a form can easily be made into a control array with codeable events.

    Nothing 'special' needs to be done to achieve this.

    You just cannot declare an object variable array with events.

  5. #5
    Guest
    You will need to create some sort of feeder object that all the Exe's talk to, and your app has a single reference to.

    The feeder object has subs that match the events that the exe's will raise. the exe's, instead of rainsing the event, call the feeder objects event sub, and the feeder object then raises the event out to the controlling program. The active exe will need to know about the feeder object - you will have to pass a reference to the feeder object to the active exe whenever one is instatiated (like a paretn refernce so to speak). This way the exe knows where to call the evetn sub, which in turn raises the event out to the calling sub. Each exe will require a unique key, which needs to be passed out through te feeder objects evetns, and you program then interoprets the events, and knows which Exe raised that event based on the key.

    Hope that makes sense - it's a bit of a complex concept

    - gaffa

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    18
    u what ? Sounds alot more complicated, but interesting, do u have example code........... :-)

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    18
    .... can an activex exe, refenence its client program ? how ? ............

  8. #8
    Guest

    good luck

    i agree with gaffa, who commits to the feeder idea...however i would use more appropriately a "wrapper" ..in other words a class who's sole
    purpose was to wrap the Exe calls in a class and
    assign the "event" out to each individual EXE....
    the assignment could be done with Select Case statements....etc...you might even use Properties to handle the Exe calls so that you would feed the Exe's to the class properties and that would allow you to reuse this class with other Exe's in the future..make it generic so that it does not tie into those exact Exe's but simply get's the Exe name and path fed into it and then...viola you have a truly useful object..

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    18
    ok.... so how do i access the slave program from the activex exe ?

  10. #10
    Guest

    call the Exe

    by adding code within the Exe to "Dim" and "Set"
    an instance of the wrapper class, how you choose to build and call that instance is up to you to design into your program.

    Remember since you have built this class as a wrapper object it can be called by anything that can call objects
    even future projects ..possibly by placing it into a DLL
    and then referencing it in any future project..

  11. #11
    New Member
    Join Date
    Feb 2001
    Posts
    7

    non-child events available?

    gaffa,

    'Scuse the interruption, but is it possible to have a non-child (already launched) application event signal another process through the event subroutine system? How?

    Ie, how can I have a non-child application run an event sub in my app? I can't use Set x = NEW y, since it launches another instance of the app.
    - huggy

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