PDA

View Full Version : Running vbscript from a c# Thread


Baaleos
08-26-2010, 02:43 PM
Ok, here is a scenario.

Our company has an API dll which we use to interact with a server / web service. The API dll is primarily intended to be used with vbscript, however, it does work with c#, albeit the implimentation is different.


A collegue created a vbscript console application which loads the dll, and uses the embedded methods to do what we want.


However, a limitation of vbscript is that it is NOT multi-threaded. Meaning Concurrent runs of the methods from the API dll will not work.


My idea however, is to create a new front end to the Application, in C#, which then calls the vbscript program on a c# thread, to allow for concurrent method calls.


More info about the scenario
The api dll, is part of quality assurance software, which allows the execution of test cases automated via Quicktest Professional.
The vbscript app can execute test sets, however, it can only run 1 test set at a time, which then does the test cases inside the test set consecutivly.

A c# port of the app, could in theory, run concurrent tests, by using the c# threading.


Basically, I would like to hear ideas for how to get this working easiest, and best implimentation.


Should I

1. Call the vbscript program on a c# process call
2. Convert the vbscript console app to a dll itself, and then include it in a c# console app, which can then be multithreaded.
3. Just re-code the whole thing in c#

sage45
09-13-2010, 02:45 PM
You know before you finalized your question at the end, I was thinking to myself, "Why not just rewrite the program to include the vbscript".

The best solution would probably be the rewrite of the vbscript into a multi-threaded c# app. Leaving it as is and running the script from a C# front-end could overcomplicate things.

-saige-