vb.net - How do I selectively communicate with two instances of a program? -
i'm new vb, , forgive me if simple question.
i running multiple time consuming (single thread) processes in program (that allows automation thru com). , save time, want open 2 or more instances of program , run them simultaneously. try on program, happens on first opened program. have intentions open 2 instances of program (which correctly), , open new document in each of instances (which open 2 new documents in myprocess0 , none in myprocess1. note: have system.diagnostics namespace activated.
using myprocess0 process = process.start(programpath) myprocess0.waitforinputidle() pws0 = new comprogram.document end using using myprocess1 process = process.start(programpath) myprocess1.waitforinputidle() pws1 = new comprogram.document end using note: com program not allow create handle program (like matlab allows mlapp.mlapp)
any appreciated it! in advance!
this not solution, current "brute" workaround. works if iterations independent of each other , wish use multiple instances of program in same computer perform these iterations (but reason unknown me, "application" objects created point first instance of application).
what i'm doing, tricking code using "desktops": http://technet.microsoft.com/en-us/sysinternals/cc817881.aspx
i open vb code , application instance in each desktop, , reason vb code interacts application opened in current desktop , not on others. happens matlab somehow. reason, matlab application objects reference first instance.
Comments
Post a Comment