hexagon logo

VB.NET Open Pcdmis with selected program file

I am trying to write an application that will organize our programs by customer. I have everything written and complete but I have one issue when I try to open pcdmis with the selected file loaded, depending on what method i'm using at the time i get the following results

1. Pcdmis opens but the program file doesn't
2. pcdmis opens and brings up the new program dialog box with the program name list in the first textbox
3. my application crashes saying file not found.

I have done this numerous times with other applications and nothing seems to work.

I have tried system.diagnostics.process.start, I have tried the shell command it just doesn't seem to work. It does work if I double click the program file in the explorer app. I have seen other programs similar to this but they don't have source code available. Has any one got this to work in vb.net(not vbscript)? I'm starting to get frustrated as I have tried 36 different ways as of right now. Taking a break and hope some one will have some insight.
Parents
  • By the way, did you get PC-DMIS installed on the PC you're developing on? Doing so registers the PC-DMIS type library on your system, making it easy to add a reference in your VS project. You can then add an "Imports PCDLRN" namespace reference if you so desire.

    I would need to test this to be fully certain it would work, but you might also be able to use GetObject with an invalid argument ("" or " ") to get your application to first try connecting to an existing instance of PC-DMIS before creating a new one:

    PcdApp = GetObject("","PCDLRN.Application")
    PcdApp.WaitUntilReady(60)
    Threading.Thread.Sleep(2000)


    The more important part of this is the WaitUntilReady and Thread.Sleep methods. If you start addressing properties on your application object before PC-DMIS is really ready, it may ignore the properties or occasionally get confused and start another instance. The WaitUntilReady method provides a flag for PC-DMIS to say it is ready to start responding to automation, and the extra two second sleep provides a bit of extra buffer for slow systems.
Reply
  • By the way, did you get PC-DMIS installed on the PC you're developing on? Doing so registers the PC-DMIS type library on your system, making it easy to add a reference in your VS project. You can then add an "Imports PCDLRN" namespace reference if you so desire.

    I would need to test this to be fully certain it would work, but you might also be able to use GetObject with an invalid argument ("" or " ") to get your application to first try connecting to an existing instance of PC-DMIS before creating a new one:

    PcdApp = GetObject("","PCDLRN.Application")
    PcdApp.WaitUntilReady(60)
    Threading.Thread.Sleep(2000)


    The more important part of this is the WaitUntilReady and Thread.Sleep methods. If you start addressing properties on your application object before PC-DMIS is really ready, it may ignore the properties or occasionally get confused and start another instance. The WaitUntilReady method provides a flag for PC-DMIS to say it is ready to start responding to automation, and the extra two second sleep provides a bit of extra buffer for slow systems.
Children
No Data