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. Wrapper for VB6 error - "The system cannot find the file specified."

Wrapper for VB6 error - "The system cannot find the file specified."

Scheduled Pinned Locked Moved Visual Basic
csharpvisual-studiocomhelp
6 Posts 4 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.
  • M Offline
    M Offline
    Marcus J Smith
    wrote on last edited by
    #1

    I have been struggling with this issue off and on for the last couple of weeks. I created a .NET project with a class that will be available to .NET and then another .NET project with a COM class that will make that first class available to VB6. I am not letting Visual Studio register the object for COM and am doing that myself. I am using the following commands to register the assembly. gacutil /i TestCode.dll /f regasm TestCode.dll /tlb:TestCode.tlb /codebase I am able to see the assembly in the references box in VB6 and I can use the intellisense but it wont let me use it. I have tried the following 2 ways to instantiate the object. Dim objTestCode As New TestCode.Testing and Dim objTestCode As TestCode.Testing Set objTestCode = New TestCode.Testing Neither of those allow me to use the code. At one time I was able to use the assembly but that was last Friday and it was when Visual Studio was doing the registering for me. The reason I am manually registering it on my own box is that I want to replicate what will occur when this is deployed to multiple servers.


    CleaKO

    "Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)

    C D 2 Replies Last reply
    0
    • M Marcus J Smith

      I have been struggling with this issue off and on for the last couple of weeks. I created a .NET project with a class that will be available to .NET and then another .NET project with a COM class that will make that first class available to VB6. I am not letting Visual Studio register the object for COM and am doing that myself. I am using the following commands to register the assembly. gacutil /i TestCode.dll /f regasm TestCode.dll /tlb:TestCode.tlb /codebase I am able to see the assembly in the references box in VB6 and I can use the intellisense but it wont let me use it. I have tried the following 2 ways to instantiate the object. Dim objTestCode As New TestCode.Testing and Dim objTestCode As TestCode.Testing Set objTestCode = New TestCode.Testing Neither of those allow me to use the code. At one time I was able to use the assembly but that was last Friday and it was when Visual Studio was doing the registering for me. The reason I am manually registering it on my own box is that I want to replicate what will occur when this is deployed to multiple servers.


      CleaKO

      "Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)

      C Offline
      C Offline
      chrispo_m
      wrote on last edited by
      #2

      Howdy, Cleako, I think I may be up against a similar problem. It sounds as if we're both aiming for the same goal. What failure do you get when you say that "it won't let me use it" ?? I posted the following question yesterday as well on a different forum within this site. --Chris --------------------------------------------------------------------- Howdy, I am an RF engineer (read: non-programmer!) building a library of GPIB-instruments that I can use from various applications (.NET C#, Excel VB6) to script a few tests. This article has been *extremely* useful, although now I'm stuck at one error in Excel VB6 I can't resolve: "File or assembly name instrument_drivers, or one of its dependencies, was not found" What does seem to be working correctly: - My dll, "instrument_drivers", shows up in the list of VB6 references - I can 'Dim x As instrument_drivers.HP8648C' in my code (and the intellisense does recognize all of the class subroutines that I've made public, - I can 'Set x = New instrument_drivers.HP8648C', again with confirmation of intellisense, - I can 'x.open_device(23)', one of the subroutines But, I get the above error when I go to run it. Google searches churn up similar problems from other programmers, notably opening permissions in a windows temp directory and disabling file indexing. All done, no luck. Any ideas or comments are greatly appreciated, --Chris

      M 1 Reply Last reply
      0
      • C chrispo_m

        Howdy, Cleako, I think I may be up against a similar problem. It sounds as if we're both aiming for the same goal. What failure do you get when you say that "it won't let me use it" ?? I posted the following question yesterday as well on a different forum within this site. --Chris --------------------------------------------------------------------- Howdy, I am an RF engineer (read: non-programmer!) building a library of GPIB-instruments that I can use from various applications (.NET C#, Excel VB6) to script a few tests. This article has been *extremely* useful, although now I'm stuck at one error in Excel VB6 I can't resolve: "File or assembly name instrument_drivers, or one of its dependencies, was not found" What does seem to be working correctly: - My dll, "instrument_drivers", shows up in the list of VB6 references - I can 'Dim x As instrument_drivers.HP8648C' in my code (and the intellisense does recognize all of the class subroutines that I've made public, - I can 'Set x = New instrument_drivers.HP8648C', again with confirmation of intellisense, - I can 'x.open_device(23)', one of the subroutines But, I get the above error when I go to run it. Google searches churn up similar problems from other programmers, notably opening permissions in a windows temp directory and disabling file indexing. All done, no luck. Any ideas or comments are greatly appreciated, --Chris

        M Offline
        M Offline
        Marcus J Smith
        wrote on last edited by
        #3

        I ended up not using the gacutil /i part and just used the regasm part but it became a 2 line command. regasm TestCode.dll /codebase regasm TestCode.dll /tlb:TestCode.tlb


        CleaKO

        "Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)

        M 1 Reply Last reply
        0
        • M Marcus J Smith

          I have been struggling with this issue off and on for the last couple of weeks. I created a .NET project with a class that will be available to .NET and then another .NET project with a COM class that will make that first class available to VB6. I am not letting Visual Studio register the object for COM and am doing that myself. I am using the following commands to register the assembly. gacutil /i TestCode.dll /f regasm TestCode.dll /tlb:TestCode.tlb /codebase I am able to see the assembly in the references box in VB6 and I can use the intellisense but it wont let me use it. I have tried the following 2 ways to instantiate the object. Dim objTestCode As New TestCode.Testing and Dim objTestCode As TestCode.Testing Set objTestCode = New TestCode.Testing Neither of those allow me to use the code. At one time I was able to use the assembly but that was last Friday and it was when Visual Studio was doing the registering for me. The reason I am manually registering it on my own box is that I want to replicate what will occur when this is deployed to multiple servers.


          CleaKO

          "Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)

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

          Curious. How are you adding the COM Guids to your assembly?? When I need to create a COM component in VB.NET, this[^] is the template I follow.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          M 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Curious. How are you adding the COM Guids to your assembly?? When I need to create a COM component in VB.NET, this[^] is the template I follow.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            M Offline
            M Offline
            Marcus J Smith
            wrote on last edited by
            #5

            I used this[^]. The class worked great and I am still confused why they say I must use Regasm AssemblyName.dll /tlb: FileName.tlb /codebase and not Regasm AssemblyName.dll /codebase Regasm AssemblyName.dll /tlb: FileName.tlb /codebase. I may be totally wrong but the only thing that worked for me was that 2nd way which I found here, partially[^] but I ended up having to use the combination of the 2. I was successful installing to the GAC but the combination of installing to the GAC and registering the assembly seemed to confuse the code.


            CleaKO

            "Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)

            1 Reply Last reply
            0
            • M Marcus J Smith

              I ended up not using the gacutil /i part and just used the regasm part but it became a 2 line command. regasm TestCode.dll /codebase regasm TestCode.dll /tlb:TestCode.tlb


              CleaKO

              "Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)

              M Offline
              M Offline
              Member 8117281
              wrote on last edited by
              #6

              I was having the same problem. the /codebase switch made it work. Thanks!

              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