|
-
Feb 19th, 2001, 05:43 AM
#1
Thread Starter
Junior Member
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
-
Feb 19th, 2001, 09:08 AM
#2
Fanatic Member
I wouldn't bother...
You cannot declare control arrays with events either.
-
Feb 19th, 2001, 09:54 AM
#3
Thread Starter
Junior Member
Oh great any solutions ?....... how is it done with other controls ? Because if its "load"ed it will add "Index" within the event ?
-
Feb 19th, 2001, 10:00 AM
#4
Fanatic Member
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.
-
Feb 20th, 2001, 06:24 AM
#5
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
-
Feb 20th, 2001, 07:50 AM
#6
Thread Starter
Junior Member
u what ? Sounds alot more complicated, but interesting, do u have example code........... :-)
-
Feb 20th, 2001, 07:58 AM
#7
Thread Starter
Junior Member
.... can an activex exe, refenence its client program ? how ? ............
-
Feb 20th, 2001, 08:46 PM
#8
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..
-
Feb 22nd, 2001, 01:05 PM
#9
Thread Starter
Junior Member
ok.... so how do i access the slave program from the activex exe ?
-
Feb 22nd, 2001, 01:43 PM
#10
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..
-
Feb 28th, 2001, 12:42 AM
#11
New Member
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.
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
|