hexagon logo

Got Visual Studio and the Interop.PCDLRN.dll... Now what?

As I upgraded one CMM to Windows 7 64-bit, my small VBS helpers died in the process (still kickin' butt on XP though).
So, I have begun re-coding them in Visual Studio 2010 (I think). I have gotten so far in the coding where I need to connect to PC-DMIS and start interfacing with it. Now, I managed to find the DLL that is supposed to expose some interfaces and methods and I have successfully added it to my project.

Then what? How do I use the DLL to connect to PC-DMIS and expose the PartPrograms collection for instance?

Oh, I am using C# for this...

Any and all input, examples or suggestions are VERY welcome!

TIA!
Parents
  • This is from my "Search PC-DMIS programs" app:

    try
    {
    Type pcdObjType = Type.GetTypeFromProgID("PCDLRN.Application");
    PCDApp = Activator.CreateInstance(pcdObjType);
    string status = "";
    /*
    this while loop starts with status = "", and will query PC-DMIS for the text in the status bar at the bottom of the screen.
    when it finally says "READY" or it contains "DONE INIT", the loop will exit
    readystr and initstr is defined in the application settings
    */
    while (status != readystr && !status.Contains(initstr))
    {
    System.Threading.Thread.Sleep(1000); // give pc-dmis a second to work
    status = PCDApp.StatusBar();
    }
    PCDStarted = true; //PC-DMIS started
    }
    catch
    //catch (System.Runtime.InteropServices.COMException f)
    {
    PCDStarted = false; // PC-DMIS did not start
    //MessageBox.Show(string.Format("PC-DMIS måste vara startat: {0}", f.Message)); // PC-DMIS needs to be started!
    //System.Windows.Forms.Application.Exit(); // Exit
    } 
    
Reply
  • This is from my "Search PC-DMIS programs" app:

    try
    {
    Type pcdObjType = Type.GetTypeFromProgID("PCDLRN.Application");
    PCDApp = Activator.CreateInstance(pcdObjType);
    string status = "";
    /*
    this while loop starts with status = "", and will query PC-DMIS for the text in the status bar at the bottom of the screen.
    when it finally says "READY" or it contains "DONE INIT", the loop will exit
    readystr and initstr is defined in the application settings
    */
    while (status != readystr && !status.Contains(initstr))
    {
    System.Threading.Thread.Sleep(1000); // give pc-dmis a second to work
    status = PCDApp.StatusBar();
    }
    PCDStarted = true; //PC-DMIS started
    }
    catch
    //catch (System.Runtime.InteropServices.COMException f)
    {
    PCDStarted = false; // PC-DMIS did not start
    //MessageBox.Show(string.Format("PC-DMIS måste vara startat: {0}", f.Message)); // PC-DMIS needs to be started!
    //System.Windows.Forms.Application.Exit(); // Exit
    } 
    
Children
No Data