|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to access desired instance of app when multiple running?GetObject gets the first instance of a program when there are more than one
open. I can determine whether it's the one that I want. But if not, is there any way to get at another instance? Here's what I've got for accessing AutoCAD R2007: Dim acadApp As Object On Error Resume Next Set acadApp = GetObject(, "AutoCAD.Application.17") BTW, working with VB6 on XP2.
Show quote
Hide quote
"Ken Krupa" <KenKr***@discussions.microsoft.com> wrote in message Short answer is - you can't. At least not reliably, and not all the time.news:A2CEFA08-3182-4419-8E77-E76985D151C7@microsoft.com... > GetObject gets the first instance of a program when there are more than one > open. I can determine whether it's the one that I want. But if not, is there > any way to get at another instance? > > Here's what I've got for accessing AutoCAD R2007: > Dim acadApp As Object > On Error Resume Next > Set acadApp = GetObject(, "AutoCAD.Application.17") > > BTW, working with VB6 on XP2. GetObject has a form where it allows you to call a specific document. Set oObj = GetObject("c:\somedoc.doc") and it will get the instance that has that doc open. If more than one do, then it is a crapshoot. (Sometimes opening it if not.) I don't know if this form will even work with AutoCad. Also appreciate that the behavior an ActiveX exe might display varys widely among applications and other factors may have impact. For example, it may depend on whether your program initially opened the app or whether the user did. This, while not dealing specifically with AutoCad might provide some insight... http://support.microsoft.com/kb/288902 (Appreciate that GetObject was written to support Office products.) You probably will need to check out the automation documentation for your specific version of AutoCad. As well as just test and see. -ralph
Inline Assembly In VB6
Database connection problem on VB6.0 There seems to be a bug in Vista's file sharing that causes the ADO Database open command to hang if Localized Error Messages Shell on Vista MS Winsock Control ports don't free up How to open a CMD Line exe as hidden and wat for it to finish Have a problem that is stumping me. VB6 DLL Assembly Compile Link how??? Full Control to Users programmatically |
|||||||||||||||||||||||