hexagon logo

Add Reference to PCDLRN.tlb not working

Apologies for the duplicate post there was a timeout first time around and I didn't think it was posted! (Can't figure out how to delete it either!)

I'm need to do some VB.Net development on a pc that doesn't have PC-DMIS installed. My understanding is that I need to add a reference to PCDLRN.tlb but when I try that I get the following error:

---------------------------
Microsoft Visual Studio Express 2012 for Windows Desktop
---------------------------
A reference to 'C:\pcdlrn.tlb' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.

I'm running VSE2012 on Windows 7 64bit. Any ideas what is going on here?

I can add reference to the same file in excel VBA on the pc with PC-DMIS installed without any issues.

Also, where can I get the Object Library reference material? I've seen other post refer to this link but it doesn't work anymore... http://www.wilcoxassoc.com/downloads/dl_documentation.php

Thanks!
Parents
  • Thank you for your reply.

    Yes that was exactly my problem but I had tried that originally and I was getting an error of some sort but when I tried it again to see what the error was it worked fine...?? Weird! It should have been obvious that that was the reason for Intellisense not working but it never occurred to me so thanks for pointing that out!

    It has led to one strange problem in my code though, after changing to early binding, I can't loop through the commands with a for each loop ie:

    Dim PCDApp As PCDLRN.Application = GetObject("", "PCDLRN.Application")
    Dim pcdPartProg As PCDLRN.PartProgram = PCDApp.ActivePartProgram
    Dim pcdCommands As PCDLRN.Commands = pcdPartProg.Commands
    
    For Each cmd In pcdCommands
    Next


    I get the error:

    Expression is of type 'PCDLRN.commands', which is not a collection type.

    for pcdCommands.

    This same code works fine when I declare each variable as Object... What am I missing here?

    I know I can do:

    For i = 0 To pcdCommands.Count - 1
    Next


    but I'm curious to know why the former doesn't work with early binding.
Reply
  • Thank you for your reply.

    Yes that was exactly my problem but I had tried that originally and I was getting an error of some sort but when I tried it again to see what the error was it worked fine...?? Weird! It should have been obvious that that was the reason for Intellisense not working but it never occurred to me so thanks for pointing that out!

    It has led to one strange problem in my code though, after changing to early binding, I can't loop through the commands with a for each loop ie:

    Dim PCDApp As PCDLRN.Application = GetObject("", "PCDLRN.Application")
    Dim pcdPartProg As PCDLRN.PartProgram = PCDApp.ActivePartProgram
    Dim pcdCommands As PCDLRN.Commands = pcdPartProg.Commands
    
    For Each cmd In pcdCommands
    Next


    I get the error:

    Expression is of type 'PCDLRN.commands', which is not a collection type.

    for pcdCommands.

    This same code works fine when I declare each variable as Object... What am I missing here?

    I know I can do:

    For i = 0 To pcdCommands.Count - 1
    Next


    but I'm curious to know why the former doesn't work with early binding.
Children
No Data