avpatil
19th March 2002, 18:52
Hi,
I am trying to USE OLE automation, calling Baan DLL from VB script. The VB script and DLL works fine if I run with one instance. I tried executing the VB script twice simulatenously and I get a BW error "message_loop_nesting error, nesting
level = 2(should be 1)" and "message_loop_nesting error, nesting level =1(should be 0)". THe DLL got excecuted fine, but the BW messages stays there and a hanging bshell. Is something different needs to be done with multiple user accessing the VB script.
Arvind Patil
mark_h
19th March 2002, 21:33
I get mixed results when doing this. When I run certain macros at the same time I get exactly the error you talk about and yet with another one of my macros I can run two of them at once. It looks like both of them use the same shell. The one that aborts with the error like yours does a lot of selects to return production order information. The one that works runs a DLL which has a function server in it.
On the one that produces the error the second run starts giving me messages about "Waiting for another Ole automation to complete". I did not write down the exact message. Not sure how to fix it to run the same code twice on my machine, but the good news is that I can run the same macro on multiple clients without problems. Try it from two separate machines. Not really sure if you need to run the same VB code on one client multiple times or just on multiple clients.
Since I am not a VB expert and most of my stuff is simple Excel macros I am not really sure how to coordinate two macros running on the same machine at the same time.
Mark
avpatil
19th March 2002, 21:42
Hi Mark,
My VB script is very simple. All I am doing in that script is calling a Baan DLL and passing the parameter. That DLL does lot of stuff. My DLL gets executed fine without any issue. But I land up in BW error (The nesting error) and with BW being hanging. I am sure if I run from multiple client this wouldn't happen. And where do I see that "OLE Automaion in Use function". Is there a way to check if the OLE Automation is free.
Arvind
mark_h
19th March 2002, 22:46
I have tried working with the getobject function to see if it was already open and running. I have not had any luck with it. I also seem to recal that in one of the baan examples they had something that checked to see if the baan application was already running, but I can not seem to find that. Maybe it was in Gordons Xbrp program and I no longer have a copy of that. I am sure Gordon will come along with a suggestion or two. :)
The error message I got was only popped up on one of the sessions, but this was after I got the error that you first mentioned. I just do not know enough about VB code to get the communication issues worked out.
Mark
gfasbender
19th March 2002, 23:16
If you need a multi-thread process, you can always create multiple Baan Objects by declaring an object array.
Dim BaanObj(10) As Object
Of course, a new BW (and license) will be created with each BaanObj(i) = CreateObject("...") call.
I don't know how you can check to see if the Baan Object is currently running a process. Sorry.