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. Portability Error

Portability Error

Scheduled Pinned Locked Moved Visual Basic
helpcsharpdotnetarchitecture
4 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.
  • P Offline
    P Offline
    Pugman812
    wrote on last edited by
    #1

    I have compiled a program and made a install file. I have 3 dependencys to my program. I am working with .NET. The other computer has been updated to .net Architecture. One dependency is an .ocx file that i have installed into the windows directory. The .ocx is a user control that is been created in 6.0 and i am referencing to this. When i reference to this .ocx it makes 2 references. After i build the project. there are 2 dll's in the folder with my .exe. Thats fine. If you move the .ocx file out of the windows folder the app does not work. So i know that the app is looking for the .ocx file in the windows folder. Its just when i install this app on another machine it instant instantly says there has been an exception that can no be handled. Then i try the same install on my computer where i have made the 2 programs and it works fine. I just dont get it because all the files that are dependencys are there and the .ocx file is in its place when i run the install program. I just dont understand why it would not work on another machine with everything in its place with .net framework installed. Any help on this portability issue would be greatly appreciated. Thank you

    D 1 Reply Last reply
    0
    • P Pugman812

      I have compiled a program and made a install file. I have 3 dependencys to my program. I am working with .NET. The other computer has been updated to .net Architecture. One dependency is an .ocx file that i have installed into the windows directory. The .ocx is a user control that is been created in 6.0 and i am referencing to this. When i reference to this .ocx it makes 2 references. After i build the project. there are 2 dll's in the folder with my .exe. Thats fine. If you move the .ocx file out of the windows folder the app does not work. So i know that the app is looking for the .ocx file in the windows folder. Its just when i install this app on another machine it instant instantly says there has been an exception that can no be handled. Then i try the same install on my computer where i have made the 2 programs and it works fine. I just dont get it because all the files that are dependencys are there and the .ocx file is in its place when i run the install program. I just dont understand why it would not work on another machine with everything in its place with .net framework installed. Any help on this portability issue would be greatly appreciated. Thank you

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

      When you place the .OCX files on the new machine, you have to register them with REGSVR32:

      C:\\Windows>REGSVR32 _filename_.ocx
      

      Once that is done, the OCX file CANNOT be moved, unless you unregister the .OCX and re-register it when it is in it's final position. This is because the full path to the .OCX file is stored in the registry so the system knows where to find the file when it needs it. Keep in mind, that .OCX files themselves, have dependencies. You must be sure that any .DLL files that the .OCX refers to are also copied to where the .OCX file expects them. You can use the Depends tool that comes with Visual Studio 6 to see what those dependencies are. You must also make sure that the dependent .DLL files are registered also, if they are ActiveX .DLL's. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      P 1 Reply Last reply
      0
      • D Dave Kreskowiak

        When you place the .OCX files on the new machine, you have to register them with REGSVR32:

        C:\\Windows>REGSVR32 _filename_.ocx
        

        Once that is done, the OCX file CANNOT be moved, unless you unregister the .OCX and re-register it when it is in it's final position. This is because the full path to the .OCX file is stored in the registry so the system knows where to find the file when it needs it. Keep in mind, that .OCX files themselves, have dependencies. You must be sure that any .DLL files that the .OCX refers to are also copied to where the .OCX file expects them. You can use the Depends tool that comes with Visual Studio 6 to see what those dependencies are. You must also make sure that the dependent .DLL files are registered also, if they are ActiveX .DLL's. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        P Offline
        P Offline
        Pugman812
        wrote on last edited by
        #3

        Thanks that worked great but how could you do this through code to register it at machine that it installs on. And how could i the my program check to see if it is already registered with that machine. Thank you

        D 1 Reply Last reply
        0
        • P Pugman812

          Thanks that worked great but how could you do this through code to register it at machine that it installs on. And how could i the my program check to see if it is already registered with that machine. Thank you

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

          It has to be done by the installer. Normaly, when you build an installer project (VB.NET) or use the Package and Deployment Wizard (VB6), this dependacy is handled for you, along with the registration of the .OCX. But, neither of these will take care of the dependancies that the .OCX file has. You'll have to add those manually. You'r app really can't check for the existance of the controls ahead of time. Your app would have to know the filename and version of each of the controls it needs, then it would have to check to see if the control is registered properly and that would require your app knowing all of the ClassID's the control registers. It's possible to do, but not worth the effort at all. Just making sure you have a properly packaged application is much easier. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          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