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
  • I don't know what your level of experience is with VB, so please don't be offended if this is below you. It sounds like it might be your issue here...

    Are you declaring your application documents as the underlying types (early-bound) and not as generic objects (late-bound)?

    If you do late-binding like what you see in a lot of the BASIC scripting posted on this forum, VS does not resolve the object types until run-time. Since the types are not known at design time, Intellisense (auto-complete) won't work:

    Dim pcdApp as Object = CreateObject("PCDLRN.Application")
    Dim pcdParts as Object = pcdApp.PartPrograms
    Dim pcdPart as Object = pcdApp.ActivePartProgram


    If you try to address the properties of any of these objects, all Intellisense will give you is the generic properties of System.Object.

    In order for Intellisense to do it's job, it needs early-bound objects like this:

    Dim pcdApp as PCDLRN.Application = CreateObject("PCDLRN.Application")
    Dim pcdParts as PCDLRN.PartPrograms = pcdApp.PartPrograms
    Dim pcdPart as PCDLRN.PartProgram = pcdApp.ActivePartProgram


    You can also add a qualifier to avoid typing out "PCDLRN" so much:

    Imports PCDLRN
    Public Class Foo
    
    Dim pcdApp as Application = CreateObject("PCDLRN.Application")
    Dim pcdParts as PartPrograms = pcdApp.PartPrograms
    Dim pcdPart as PartProgram = pcdApp.ActivePartProgram
    
    End Class


    Now, whenever you address pcdApp, pcdParts, or pcdPart, Intellisense will provide you with all the members.
Reply
  • I don't know what your level of experience is with VB, so please don't be offended if this is below you. It sounds like it might be your issue here...

    Are you declaring your application documents as the underlying types (early-bound) and not as generic objects (late-bound)?

    If you do late-binding like what you see in a lot of the BASIC scripting posted on this forum, VS does not resolve the object types until run-time. Since the types are not known at design time, Intellisense (auto-complete) won't work:

    Dim pcdApp as Object = CreateObject("PCDLRN.Application")
    Dim pcdParts as Object = pcdApp.PartPrograms
    Dim pcdPart as Object = pcdApp.ActivePartProgram


    If you try to address the properties of any of these objects, all Intellisense will give you is the generic properties of System.Object.

    In order for Intellisense to do it's job, it needs early-bound objects like this:

    Dim pcdApp as PCDLRN.Application = CreateObject("PCDLRN.Application")
    Dim pcdParts as PCDLRN.PartPrograms = pcdApp.PartPrograms
    Dim pcdPart as PCDLRN.PartProgram = pcdApp.ActivePartProgram


    You can also add a qualifier to avoid typing out "PCDLRN" so much:

    Imports PCDLRN
    Public Class Foo
    
    Dim pcdApp as Application = CreateObject("PCDLRN.Application")
    Dim pcdParts as PartPrograms = pcdApp.PartPrograms
    Dim pcdPart as PartProgram = pcdApp.ActivePartProgram
    
    End Class


    Now, whenever you address pcdApp, pcdParts, or pcdPart, Intellisense will provide you with all the members.
Children