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
  • Try changing to

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

  • Imports PCDLRN Imports PCDLRN.PCDSCANDIR1 Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 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) End Sub End Class

    The PC-DMIS version I am using is 2023, but an error occurred when I switched to the 2022 PC version. Error occurred: System exception: Unable to create FX component. Most importantly, when I switched to version 2023, I was unable to debug properly. I am using VS2022 software and the development language is VB. NET. If you have any relevant examples, can you send them to me for testing.

Reply
  • Imports PCDLRN Imports PCDLRN.PCDSCANDIR1 Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 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) End Sub End Class

    The PC-DMIS version I am using is 2023, but an error occurred when I switched to the 2022 PC version. Error occurred: System exception: Unable to create FX component. Most importantly, when I switched to version 2023, I was unable to debug properly. I am using VS2022 software and the development language is VB. NET. If you have any relevant examples, can you send them to me for testing.

Children
No Data