hexagon logo

Problems with VB.NET programs

          Good New Year, I met VB NET and PC-DMIS interaction issue, the program can run normally on VB6, and on VB Unable to run normally on NET, obtain Interop PCDLRN, I also reported an error when reading data on the corresponding version. I feel very distressed. I have PC software versions available in 2017 and 2023, which have compatibility issues. How can I solve this problem by referencing the COM project? Is there any relevant instance that can be used to obtain PCdmis related content in general reality.

Dim pcdApp As Application = CreateObject("PCDLRN.Application")
Dim pcdParts As PartPrograms = pcdApp.PartPrograms
Dim pcdPart As PartProgram = pcdApp.ActivePartProgram
Dim pcName = pcdPart.Name
MsgBox(pcName)

This is my second time working on this project. Do you have any relevant examples to provide? I am unable to run the program normally.thanks you

Parents
  • Hi  

    Can you explain further the issue you are having?

    A quick glance here I want to say that you need to do it in this order. Dim with Declaration, then you need to Set the variable.

    Sub Main
    
    Dim DmisApp As Object
    Dim DmisPart As Object
    Dim PartName As String
    
    Set DmisApp = CreateObject("PCDLRN.Application")
    Set DmisPart = DmisApp.ActivePartProgram
    Set PartName = DmisPart.Name
    
    MsgBox(PartName)
    
    End Sub

Reply
  • Hi  

    Can you explain further the issue you are having?

    A quick glance here I want to say that you need to do it in this order. Dim with Declaration, then you need to Set the variable.

    Sub Main
    
    Dim DmisApp As Object
    Dim DmisPart As Object
    Dim PartName As String
    
    Set DmisApp = CreateObject("PCDLRN.Application")
    Set DmisPart = DmisApp.ActivePartProgram
    Set PartName = DmisPart.Name
    
    MsgBox(PartName)
    
    End Sub

Children