Jump to content

C# net Opens new acad.exe everytime i check if app is open


Recommended Posts

Posted (edited)

SOLVED

 

MY bad! i had a method that was creating an instance of the AcadApplication().

 

 

 

Hi.

 

i've this code to run open the autocad or to check if it is opened

public AcadApplication abrirApp()
       {
           try  //get a running AutoCAD instance if avaialbale
           {
               app = (AcadApplication)System.Runtime.InteropServices.Marshal.GetActiveObject(sAcadID);
           }
           catch  //none found so start a new instance
           {
               System.Type AcadProg = System.Type.GetTypeFromProgID(sAcadID);
               app = (AcadApplication)System.Activator.CreateInstance(AcadProg);
               
           }
           if (app != null)
           {
               app.Visible = true; //could leave this false to hide Acad from the user
               
           }
           return app;
       }

 

and everytime i run it even if the app is running i get another acad.exe being runned. it's doesn't open a new application just the exe. Anyway around it?

 

Thanks

Edited by moniz

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...