Asyncronous method call and WRQ Reflection
Author |
Message |
Paul Turle #1 / 18
|
Asyncronous method call and WRQ Reflection
I've solved this problem with a klugy work-around but I don't like the way I did it... I need to multiple concurrent "batch" processes that pull results from a mainframe database using automated WRQ Reflection sessions. I've created a COM component to do this that I intended to run from a remote server in MTS. The problem is that even though my method call is asynchronous (i.e. the method call finishes prior to a timer event which starts the actual process,) The client code that fired the method gets stalled until the entire process is finished. Here are the ugly details: I have a VB app that queues up batch jobs to extract data from a PICK system using scripting in WRQ Reflection terminal emulation. Each of the requests is saved as a record in an Access table that my app. reads in a loop, deletes the current record (batch job request) from the queue table and processes it. For each request, it fires up a Reflection session using OLE Automation, sends a process request to the dark side and then when the script finishes, saves the results into a text file on the PC. Since each of these jobs takes a while to run, I'd like to be able to run a specified number of them concurrently. I have a class in a COM DLL component that does the automation against Reflection. A method call uses a timer object in code instantiated from a timer control on a form in the project (there isn't any code behind the form) - and then the method code completes. When the timer object fires, it starts the code that does the actual work. What I didn't expect is that as soon as the automation code against Reflection starts a terminal session, the client code stops running until the Reflection session is closed. Apparently Reflection knows how to hang the entire process while it runs - how selfish! I ended up abandoning the whole remote component idea and created a stand-alone EXE that I'm using to run instances at the same time - not a cool server solution. Is there any way to spin off a new process after killing the original object from the client? Any other ideas for creating a truly asynchronous process? -- Paul Turley, MCT, MCSD
www.createsolutions.net ** Please copy replies by e-mail **
|
Tue, 08 Apr 2003 03:00:00 GMT |
|
|
Phillip War #2 / 18
|
Asyncronous method call and WRQ Reflection
Paul, ActiveX _Dll's_ *cannot* be used to provide asynchronous operation. You *must* use an ActiveX EXE. Change the Project Type and have another go ... HTH, Phill W. Quote: > I have a class in a COM DLL component that does the automation against > Reflection. A method call uses a timer object in code instantiated from a > timer control on a form in the project (there isn't any code behind the > form) - and then the method code completes. > . . .
|
Tue, 08 Apr 2003 03:00:00 GMT |
|
|
Paul Turle #3 / 18
|
Asyncronous method call and WRQ Reflection
<<Reply to Benjamin Scott
425.687.3955 >> <I welcome any other input. Please read Mr.s Scott's private e-mail reply at the end> No, Mr. Scott. My client is not Columbia Ultimate Business Systems - though I do have a number of associates who work for CUBS. Do you have some experience automating Reflection from VB? I have done plenty of work with several ActiveX automation servers and have never seen the same type of behavior that I described in my request for CONSTRUCTIVE ASSISTANCE. I did compile my component as both an In-Proc DLL and an EXE. In both cases, Reflection doesn't yield control to any other process in the chain while it is running - unique behavior indeed. Try this simple experiment - start a Reflection session from automation code behind a VB form in an executable project and give it something to do that will take a while (say, an hour or so.) During the session, try to set focus to that form. You can't! Interesting, isn't it? Again: all I want to do is start up one (or more) automated Reflection sessions and then let my user continue to use the application while they are running. I found a solution but it wasn't elegant. Did you have something constructive to add to this conversation? Your comment... "if an MCSD is unable to get an ActiveX server app going." is not only rude but a display of sheer ignorance. Perhaps you missed the point of my question in your zeal to criticize. I'm sorry, did you actually have some experience with this issue or were you just out and about passing out free advice? If you do actually know something about this, please enlighten me. If not, then kindly educate yourself or {*filter*}out. It's possible that I have missed something simple here but don't recall any questions regarding the idiosyncrasies of terminal emulation software or mini/mainframe systems on my MCSD exams - so no, I don't feel like an idiot after your childish remark. Seems the purpose of the public newsgroups community is to ASSIST developers with our eclectic experience in the industry (or you could just go around and find people to point and laugh at - that's your professional choice) So, Mr. Scott, why don't you step up to the plate and solve the problem? Show me two asynchronous background Reflection sessions launched from a VB app. that let's the user interact with a form while reflection is talking to PICK. Paul Turley, MCSD, MCT, MSFCT
www.createsolutions.net Quote: -----Original Message-----
Sent: Friday, February 02, 2001 12:11 PM
Subject: CUBS? I came across your post "Asyncronous method call and WRQ Reflection" in the microsoft.public.vb.ole newsgroup and was wondering if the PICK system you're working with is Columbia Ultimate? Because, if an MCSD is unable to get an ActiveX server app going with Reflections, then I'll just give up now. Thanks, Benjamin Scott
425.687.3955 -- Paul Turley, MCT, MCSD, MSF-CT
www.createsolutions.net Coauthor: Professional Access 2000 Programming, Wrox Press ** Please copy replies by e-mail **
> I've solved this problem with a klugy work-around but I don't like the way I > did it... > I need to multiple concurrent "batch" processes that pull results from a > mainframe database using automated WRQ Reflection sessions. I've created a > COM component to do this that I intended to run from a remote server in MTS. > The problem is that even though my method call is asynchronous (i.e. the > method call finishes prior to a timer event which starts the actual > process,) The client code that fired the method gets stalled until the > entire process is finished. > Here are the ugly details: > I have a VB app that queues up batch jobs to extract data from a PICK system > using scripting in WRQ Reflection terminal emulation. Each of the requests > is saved as a record in an Access table that my app. reads in a loop, > deletes the current record (batch job request) from the queue table and > processes it. For each request, it fires up a Reflection session using OLE > Automation, sends a process request to the dark side and then when the > script finishes, saves the results into a text file on the PC. Since each > of these jobs takes a while to run, I'd like to be able to run a specified > number of them concurrently. > I have a class in a COM DLL component that does the automation against > Reflection. A method call uses a timer object in code instantiated from a > timer control on a form in the project (there isn't any code behind the > form) - and then the method code completes. When the timer object fires, it > starts the code that does the actual work. What I didn't expect is that as > soon as the automation code against Reflection starts a terminal session, > the client code stops running until the Reflection session is closed. > Apparently Reflection knows how to hang the entire process while it runs - > how selfish! > I ended up abandoning the whole remote component idea and created a > stand-alone EXE that I'm using to run instances at the same time - not a > cool server solution. Is there any way to spin off a new process after > killing the original object from the client? Any other ideas for creating a > truly asynchronous process? > -- > Paul Turley, MCT, MCSD
> www.createsolutions.net > ** Please copy replies by e-mail **
|
Wed, 23 Jul 2003 19:25:21 GMT |
|
|
Nigel Hatchet #4 / 18
|
Asyncronous method call and WRQ Reflection
Paul, The component you have created is a DLL and as such will run in-process with your controlling application. If you use a timer to get it going it will just hog the processor once it regains control of the process. You can however make your component an ActiveX EXE (i.e. an out of process component) which can create and run muliple objects on multiple threads. Hope this helps Nigel Hatchett www.aristoline.co.uk
Quote: > <<Reply to > Benjamin Scott
> 425.687.3955 >> > <I welcome any other input. Please read Mr.s Scott's private e-mail reply > at the end> > No, Mr. Scott. My client is not Columbia Ultimate Business Systems - though > I do have a number of associates who work for CUBS. > Do you have some experience automating Reflection from VB? I have done > plenty of work with several ActiveX automation servers and have never seen > the same type of behavior that I described in my request for CONSTRUCTIVE > ASSISTANCE. I did compile my component as both an In-Proc DLL and an EXE. > In both cases, Reflection doesn't yield control to any other process in the > chain while it is running - unique behavior indeed. Try this simple > experiment - start a Reflection session from automation code behind a VB > form in an executable project and give it something to do that will take a > while (say, an hour or so.) During the session, try to set focus to that > form. You can't! Interesting, isn't it? Again: all I want to do is start > up one (or more) automated Reflection sessions and then let my user continue > to use the application while they are running. I found a solution but it > wasn't elegant. > Did you have something constructive to add to this conversation? Your > comment... "if an MCSD is unable to get an ActiveX server app going." is not > only rude but a display of sheer ignorance. Perhaps you missed the point of > my question in your zeal to criticize. I'm sorry, did you actually have > some experience with this issue or were you just out and about passing out > free advice? If you do actually know something about this, please enlighten > me. If not, then kindly educate yourself or {*filter*}out. It's possible that I > have missed something simple here but don't recall any questions regarding > the idiosyncrasies of terminal emulation software or mini/mainframe systems > on my MCSD exams - so no, I don't feel like an idiot after your childish > remark. Seems the purpose of the public newsgroups community is to ASSIST > developers with our eclectic experience in the industry (or you could just > go around and find people to point and laugh at - that's your professional > choice) > So, Mr. Scott, why don't you step up to the plate and solve the problem? > Show me two asynchronous background Reflection sessions launched from a VB > app. that let's the user interact with a form while reflection is talking to > PICK. > Paul Turley, MCSD, MCT, MSFCT
> www.createsolutions.net > -----Original Message-----
> Sent: Friday, February 02, 2001 12:11 PM
> Subject: CUBS? > I came across your post "Asyncronous method call and WRQ Reflection" in the > microsoft.public.vb.ole newsgroup and was wondering if the PICK system > you're working with is Columbia Ultimate? Because, if an MCSD is unable to > get an ActiveX server app going with Reflections, then I'll just give up > now. Thanks, > Benjamin Scott
> 425.687.3955 > -- > Paul Turley, MCT, MCSD, MSF-CT
> www.createsolutions.net > Coauthor: Professional Access 2000 Programming, Wrox Press > ** Please copy replies by e-mail **
> > I've solved this problem with a klugy work-around but I don't like the way > I > > did it... > > I need to multiple concurrent "batch" processes that pull results from a > > mainframe database using automated WRQ Reflection sessions. I've created > a > > COM component to do this that I intended to run from a remote server in > MTS. > > The problem is that even though my method call is asynchronous (i.e. the > > method call finishes prior to a timer event which starts the actual > > process,) The client code that fired the method gets stalled until the > > entire process is finished. > > Here are the ugly details: > > I have a VB app that queues up batch jobs to extract data from a PICK > system > > using scripting in WRQ Reflection terminal emulation. Each of the > requests > > is saved as a record in an Access table that my app. reads in a loop, > > deletes the current record (batch job request) from the queue table and > > processes it. For each request, it fires up a Reflection session using > OLE > > Automation, sends a process request to the dark side and then when the > > script finishes, saves the results into a text file on the PC. Since each > > of these jobs takes a while to run, I'd like to be able to run a specified > > number of them concurrently. > > I have a class in a COM DLL component that does the automation against > > Reflection. A method call uses a timer object in code instantiated from a > > timer control on a form in the project (there isn't any code behind the > > form) - and then the method code completes. When the timer object fires, > it > > starts the code that does the actual work. What I didn't expect is that > as > > soon as the automation code against Reflection starts a terminal session, > > the client code stops running until the Reflection session is closed. > > Apparently Reflection knows how to hang the entire process while it runs - > > how selfish! > > I ended up abandoning the whole remote component idea and created a > > stand-alone EXE that I'm using to run instances at the same time - not a > > cool server solution. Is there any way to spin off a new process after > > killing the original object from the client? Any other ideas for creating > a > > truly asynchronous process? > > -- > > Paul Turley, MCT, MCSD
> > www.createsolutions.net > > ** Please copy replies by e-mail **
|
Fri, 25 Jul 2003 18:00:51 GMT |
|
|
#5 / 18
|
Asyncronous method call and WRQ Reflection
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
|
Stielmond N #6 / 18
|
Asyncronous method call and WRQ Reflection
Hi, I needed to detect if there is a running instance of an application and attempts to accomplish that with the following codes: Dim myObj As Object Set myObj = GetObject(, "MyClass") If myObj is nothing <> True then .... ... ... End if however, myObj is always "Nothing" even when the application of concern is running. I do not include ("") as the pathname as GetObject() would launch the application which defeats my objective. Can someone shed some light. Thanks in advance. Regards, Stielmond NG
|
Tue, 23 Sep 2003 14:19:23 GMT |
|
|
Stielmond N #7 / 18
|
Asyncronous method call and WRQ Reflection
Hi, I needed to detect if there is a running instance of an application and attempts to accomplish that with the following codes: Dim myObj As Object Set myObj = GetObject(, "MyClass") If myObj is nothing <> True then .... ... ... End if however, myObj is always "Nothing" even when the application of concern is running. I do not include ("") as the pathname as GetObject() would launch the application which defeats my objective. Can someone shed some light. Thanks in advance. Regards, Stielmond NG
|
Tue, 23 Sep 2003 14:57:25 GMT |
|
|
Egbert Niero #8 / 18
|
Asyncronous method call and WRQ Reflection
Quote: > Set myObj = GetObject(, "MyClass")
this must be Set myObj = GetObject(, "YourProject.MyClass") However, I wonder whether you took special measures to have the MyClass object in the ROT (Running Object Table) since VB cannot support that out of the box. -- Session management for webfarms: http://www.nieropwebconsult.nl/asp_session_manager.htm
Quote: > Hi,
|
Tue, 23 Sep 2003 16:26:57 GMT |
|
|
Stielmond N #9 / 18
|
Asyncronous method call and WRQ Reflection
Bingo. Thanks for your reply, can I know how I can register the MyClass object in the ROT? Thanks very much. Quote:
> > Set myObj = GetObject(, "MyClass") > this must be > Set myObj = GetObject(, "YourProject.MyClass") > However, I wonder whether you took special measures to have the MyClass > object in the ROT (Running Object Table) since VB cannot support that out of > the box. > -- > Session management for webfarms: > http://www.nieropwebconsult.nl/asp_session_manager.htm
> > Hi,
|
Tue, 23 Sep 2003 16:55:38 GMT |
|
|
#10 / 18
|
Asyncronous method call and WRQ Reflection
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
|
Egbert Niero #11 / 18
|
Asyncronous method call and WRQ Reflection
sorry about the image the copy-paste and outlook express 6 automatically did attach.
|
Tue, 23 Sep 2003 18:14:34 GMT |
|
|
#12 / 18
|
Asyncronous method call and WRQ Reflection
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
|
Roger Abbot #13 / 18
|
Asyncronous method call and WRQ Reflection
Quote:
> Copy paste from the MSDN > Give Your Classes GetObject Support
<<MSDN code snipped>> I have used this and it works. I found the article on the MSDN CDROM but not the sample code, without which you can't use it. I can't find it anywhere on the MSDN web site either. I have the original ZIP, which came from a Matthew Curland article in VBPJ in 1997 (MSDN has reproduced the text but not the code that goes with it). If you can't find it either I could post it on the web site, if Matthew does not object. There is an updated and improved version in his book Advanced VB 6 programming. -- Roger Abbott http://www.rhaminisys.com DDE ActiveX Controls for VB. DDE FAQ Other freeware and shareware
|
Tue, 23 Sep 2003 20:02:50 GMT |
|
|
Egbert Niero #14 / 18
|
Asyncronous method call and WRQ Reflection
the code is downloadable from http://www.devx.com/premier/mgznarch/vbpj/1997/08aug97/bbelt.pdf it's for premier members only :< but a one months membership just costs $4 or so... -- Session management for webfarms: http://www.nieropwebconsult.nl/asp_session_manager.htm
Quote:
> > Copy paste from the MSDN > > Give Your Classes GetObject Support > <<MSDN code snipped>> > I have used this and it works. I found the article on the MSDN CDROM but > not the sample code, without which you can't use it. I can't find it > anywhere on the MSDN web site either. I have the original ZIP, which > came from a Matthew Curland article in VBPJ in 1997 (MSDN has reproduced > the text but not the code that goes with it). If you can't find it > either I could post it on the web site, if Matthew does not object. > There is an updated and improved version in his book Advanced VB 6 > programming. > -- > Roger Abbott > http://www.rhaminisys.com > DDE ActiveX Controls for VB. DDE FAQ > Other freeware and shareware
|
Tue, 23 Sep 2003 23:13:58 GMT |
|
|
Alexander Kienzl #15 / 18
|
Asyncronous method call and WRQ Reflection
Damned, that's not fair, I cannot download the reply of Egbert, but I'd like to know how I can register my objects in the ROT. Can someone please send the reply again... Alex
Quote: > Bingo. Thanks for your reply, can I know how I can register the MyClass object > in the ROT? > Thanks very much.
> > > Set myObj = GetObject(, "MyClass") > > this must be > > Set myObj = GetObject(, "YourProject.MyClass") > > However, I wonder whether you took special measures to have the MyClass > > object in the ROT (Running Object Table) since VB cannot support that out of > > the box. > > -- > > Session management for webfarms: > > http://www.nieropwebconsult.nl/asp_session_manager.htm
> > > Hi,
|
Tue, 23 Sep 2003 23:25:00 GMT |
|
|
Page 1 of 2
|
[ 18 post ] |
|
Go to page:
[1]
[2] |
|