Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. call 3rd parity dll with CreateObject

call 3rd parity dll with CreateObject

Scheduled Pinned Locked Moved Visual Basic
c++
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    b43r_3oo3
    wrote on last edited by
    #1

    hiho, I've got 3rd parity dll and want to bind them in my code with "CreateObject". with "dim t as new dll.klasse" it runs but not with "CreateObject". The Code of the dll is not managed c++ code and i don't have the source code

    D 1 Reply Last reply
    0
    • B b43r_3oo3

      hiho, I've got 3rd parity dll and want to bind them in my code with "CreateObject". with "dim t as new dll.klasse" it runs but not with "CreateObject". The Code of the dll is not managed c++ code and i don't have the source code

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      CreateObject will NOT let you do something like Dim t As New MyClass. CreateObject is used for late-bound creation of objects. In order to create objects using Dim, you have to add a reference to the .DLL and this will only work if the .DLL is COM-based. So, how you can use this .DLL depends entirely on the .DLL and the version of VB you're using. You can't just use it "the way you want to".

      Dave Kreskowiak Microsoft MVP - Visual Basic

      B 1 Reply Last reply
      0
      • D Dave Kreskowiak

        CreateObject will NOT let you do something like Dim t As New MyClass. CreateObject is used for late-bound creation of objects. In order to create objects using Dim, you have to add a reference to the .DLL and this will only work if the .DLL is COM-based. So, how you can use this .DLL depends entirely on the .DLL and the version of VB you're using. You can't just use it "the way you want to".

        Dave Kreskowiak Microsoft MVP - Visual Basic

        B Offline
        B Offline
        b43r_3oo3
        wrote on last edited by
        #3

        sry, i mean wat u say.. i declare a variable with dim t as object and then i want to set the variable with Set t = CreateObject("mydll.myclass"). but it diddn't run

        D 1 Reply Last reply
        0
        • B b43r_3oo3

          sry, i mean wat u say.. i declare a variable with dim t as object and then i want to set the variable with Set t = CreateObject("mydll.myclass"). but it diddn't run

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Is the .DLL a COM-based DLL and is it registered, using REGSVR32? If not, you can't use CreateObject. CreateObject can only be used to create COM-based objects. You can't just specify a .DLL filename and some name. You MUST use the COM-exposed name (ProgID) of the object in the library you want.

          Dave Kreskowiak Microsoft MVP - Visual Basic

          B 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Is the .DLL a COM-based DLL and is it registered, using REGSVR32? If not, you can't use CreateObject. CreateObject can only be used to create COM-based objects. You can't just specify a .DLL filename and some name. You MUST use the COM-exposed name (ProgID) of the object in the library you want.

            Dave Kreskowiak Microsoft MVP - Visual Basic

            B Offline
            B Offline
            b43r_3oo3
            wrote on last edited by
            #5

            yes the dll is registered. i've searched in the registry and found the clsid with progid.. but when i use them.. it dosen't run. The Name of the ProgID is "BARCODE.BarcodeCtrl.1" and the class name is "Barcode". When i call "Set myVar = CreateObject("BARCODE.BarcodeCtrl.1.Barcode")" then i get the error.. .. i've even tested without the class.. and it runs!! but i'm not sure with object i've get.. i hope it was the barcode-class object

            D 1 Reply Last reply
            0
            • B b43r_3oo3

              yes the dll is registered. i've searched in the registry and found the clsid with progid.. but when i use them.. it dosen't run. The Name of the ProgID is "BARCODE.BarcodeCtrl.1" and the class name is "Barcode". When i call "Set myVar = CreateObject("BARCODE.BarcodeCtrl.1.Barcode")" then i get the error.. .. i've even tested without the class.. and it runs!! but i'm not sure with object i've get.. i hope it was the barcode-class object

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              You can only use the ProdID, without appending the class name:

              Set myvar = CreateObject("BARCODE.BarcodeCtrl.1")
              

              That should represent the COM object (class) that you're looking for.

              Dave Kreskowiak Microsoft MVP - Visual Basic

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups