Re: AxtiveX EXE Is this Possible
From: Ian (ian_at_NoWhere.com)
Date: 08/25/04
- Next message: Nico: "Re: How to sum up the records in a field"
- Previous message: Tony Proctor: "Re: AxtiveX EXE Is this Possible"
- In reply to: Tony Proctor: "Re: AxtiveX EXE Is this Possible"
- Next in thread: Dan Barclay: "Re: AxtiveX EXE Is this Possible"
- Reply: Dan Barclay: "Re: AxtiveX EXE Is this Possible"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 25 Aug 2004 17:58:20 +0100
Thanks Tony
I'll read up on Threads and Process tomorrow.
And hope fully it will become clearer.
Ian
"Tony Proctor" <tony_proctor@aimtechnology_NoMoreSPAM_.com> wrote in message
news:OUfeF0riEHA.384@TK2MSFTNGP10.phx.gbl...
> An ActiveX EXE is a separate "process", with its own address space, but
> (like any process) may have multiple "threads". Sounds like you need a
> reference that talks about threads and processes Ian. Unfortunately, I
don't
> have one to hand. Basically, a 'thread' is s schedulable unit to the O/S.
>
> The statements:
> Set MyTester1 = New MyTestRunnerActiveXEXE
> Set MyTester2 = New MyTestRunnerActiveXEXE
> Set MyTester3 = New MyTestRunnerActiveXEXE
> Set MyTester4 = New MyTestRunnerActiveXEXE
> (where MyTestRunnerActiveXEXE is some class) will *not* create 4
instances.
> Give it a try. It will create 4 separate objects hosted within the same
> ActiveX EXE instance
>
> The statements:
> MyTester1.TestNumber = 3
> MyTester2.TestNumber = 3
> MyTester3.TestNumber = 3
> MyTester4.TestNumber = 3
> will not put your system under any load. They will all execute
sequentially,
> one at a time. As I've already said, each method call will block until
it's
> finished, and you need to so something special to achieve a "non-blocking
> method call".
>
> Tony Proctor
>
> "Ian" <ian@NoWhere.com> wrote in message
> news:#0WmuqriEHA.644@tk2msftngp13.phx.gbl...
> > Hi Tony
> >
> > Thanks for you information. Just a few things.
> >
> > I thought that and ActiveX EXE always ran in it's own thread and that
was
> > the point of doing it that way as apposs to a DLL?
> >
> > So all I had to do is reference the ActiveX EXE form my VB Controller
App
> > Then loading the EXE's into variables like this.
> >
> > Private MyTester1 As MyTestRunnerActiveXEXE
> > Private MyTester2 As MyTestRunnerActiveXEXE
> > Private MyTester3 As MyTestRunnerActiveXEXE
> > Private MyTester4 As MyTestRunnerActiveXEXE
> >
> > Set MyTester1 = New MyTestRunnerActiveXEXE
> > Set MyTester2 = New MyTestRunnerActiveXEXE
> > Set MyTester3 = New MyTestRunnerActiveXEXE
> > Set MyTester4 = New MyTestRunnerActiveXEXE
> >
> > This would then create 4 seporat instances of it in it's own address
> space.
> >
> > I could then Set a property of the MyTestRunnerActiveXEXE Something
like
> > TestNumber
> >
> > MyTester1.TestNumber = 3
> > MyTester2.TestNumber = 3
> > MyTester3.TestNumber = 3
> > MyTester4.TestNumber = 3
> >
> > And then just call some sort of RunTest Method
> >
> > MyTester1.RunTest
> > MyTester2.RunTest
> > MyTester3.RunTest
> > MyTester4.RunTest
> >
> >
> > I thought that something like this would then load the ActiveX EXE's up
> all
> > seporatly from each other and they could then go and run the same tests
no
> > "IansApp" completley seporatly from each other. As though it was Four
> people
> > sitting Controlling "IansApp".
> > And should something bom out on one of them it would not efect the rest
of
> > the tests at all.
> >
> >
> > I am busy doing the MSDN Coffee Monitor example to refresh this stuf in
my
> > head now.
> >
> > Am I on the right track with thinking that if i build a ActiveX EXE I
can
> > use "Component Services" to run it remotly from my PC.
> >
> >
> > Thanks for your time.
> >
> > Ian
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > "Tony Proctor" <tony_proctor@aimtechnology_NoMoreSPAM_.com> wrote in
> message
> > news:%23j3mtUqiEHA.632@TK2MSFTNGP12.phx.gbl...
> > > This could work Ian, with a few changes. You won't be able to invoke 5
> > > distinct instances of the same ActiveX EXE on a given machine, from a
> > > single client. All classes instantiated from that client will be
within
> a
> > > single instance of your ActiveX EXE. However, what you can do is set
> > 'Thread
> > > per Object' on its project properties. This effectively makes it
> > > multi-threaded. Each class instance then runs in its own thread.
> > >
> > > If you haven't used threads before, don't panic. VB pretty much
isolates
> > > them from each other so that they don't share any data, and they each
> run
> > > independently. You should be able to compile your existing IansApp.exe
> as
> > an
> > > ActiveX EXE (with that thread-per-object set) and each thread will
then
> > run
> > > a completely independent copy of it :-)
> > >
> > > The only thing I can think of to beware of are resource names, e.g.
file
> > > names, etc. You'll need to make their names thread specific if you
want
> to
> > > avoid any clashes. You can use the thread ID, from App.ThreadID, to do
> > this.
> > >
> > > In order to achieve this, you'll need to perform "non-blocking method
> > calls"
> > > on your ActiveX EXE's classes, otherwise you won't be able to start a
> 2nd
> > > one until the 1st one has finished, etc. I believe there's still the
> > "coffee
> > > pot" example of how to do this on MSDN. In summary, it involves each
of
> > > those method calls starting a single-shot timer for a very short time
> > later.
> > > Each method call can then return control to the client in order to
start
> > the
> > > next one. However, when the timers goes off then their handlers can
run
> > your
> > > IansApp code in the associated thread.
> > >
> > > Tony Proctor
> > >
> > > "Ian" <ian@NoWhere.com> wrote in message
> > > news:uAmdP7oiEHA.712@TK2MSFTNGP09.phx.gbl...
> > > > Hi All
> > > >
> > > > Background:
> > > > I have an application that requires load testing. I will call it
> > "IansApp"
> > > > for now. I unfortunately have a limitation on the number of machine
> > > > available for running this test and I am only one person.
> > > > I can write vb code to automate tests on "IansApp". And the
"IansApp"
> > can
> > > > have many instances loaded on one machine.
> > > >
> > > > So my idea is this.
> > > >
> > > > Create one controlling VB App and a ActiveX EXE application. Then by
> > > placing
> > > > this ActiveX EXE application one let say 5 machines on the network I
> can
> > > > then use my VB App to start all of the ActiveX EXE running from one
> > > location
> > > > and let say start then each 5 times per machine that would then give
> the
> > > > appearance of 25 users. The ActiveX EXE will be pretty much self
> > > contained.
> > > > There will be no transaction involved all that I will really need is
> to
> > > get
> > > > a test completed back from them once they have completed running.
And
> to
> > > > hand an ID value to them so that they know what test to run.
> > > >
> > > > Is this possible using DCOM and Component Services (MTS it used to
be
> > > > called).
> > > > Sorry but it has been a while since I have done COM development.
> > > >
> > > >
> > > > I know that 5 Machines running 5 "IansApp" is not the same as 25
> > machines
> > > > running One each. but it is better than the tests I am running now.
> > > > One machine running One "IansApp"
> > > >
> > > >
> > > > Many Thanks,
> > > >
> > > > Ian
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
- Next message: Nico: "Re: How to sum up the records in a field"
- Previous message: Tony Proctor: "Re: AxtiveX EXE Is this Possible"
- In reply to: Tony Proctor: "Re: AxtiveX EXE Is this Possible"
- Next in thread: Dan Barclay: "Re: AxtiveX EXE Is this Possible"
- Reply: Dan Barclay: "Re: AxtiveX EXE Is this Possible"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|