hexagon logo

visual studio

I am struggling with two problems. Hopefully someone can help.
The following code will open pcdmis 2014.1, 32 bit, execute a program and close pcdmis.

1) How can I make pcdmis visible? Seems like "PCDApp.visible = True" doesn't do anything.
2) How can I make the application moveable when pcdmis is running? The application can be moved around the screen before and after pcdmis runs, but not during.

Dim PCDApp, PCDPartPrograms, PCDPartProgram
        PCDApp = CreateObject("PCDLRN.Application")
        PCDApp.visible = True
        PCDPartPrograms = PCDApp.PartPrograms
        PCDPartPrograms.Open("c:\test.PRG", "CMM1")
        PCDPartProgram = PCDApp.ActivePartProgram
        PCDPartProgram.Execute()
        PCDPartProgram.Close()
        PCDApp.Quit()
Parents
  • Are you sure you're not doing them too soon? The VB code after .AsyncExecute will be executed immediately - you have to move .Close and .Quit so they are not executed until after the EndExecution Events have transpired. Also note that the .Close and .Quit can not be put in the EndExecution event handler, it's usually impossible to call back to the server inside a server event handler.
Reply
  • Are you sure you're not doing them too soon? The VB code after .AsyncExecute will be executed immediately - you have to move .Close and .Quit so they are not executed until after the EndExecution Events have transpired. Also note that the .Close and .Quit can not be put in the EndExecution event handler, it's usually impossible to call back to the server inside a server event handler.
Children
No Data