Results 1 to 6 of 6

Thread: distribute OCX

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Texas
    Posts
    111
    Hello Everybody.

    I am needing to distribute the Common Dialog OCX with an Excel spreadsheet. I am looking for the most lightweight solution. I know I can set up a P&D package, but I don't want to distribute all of the VB runtime files. I just want to distibute the OCX itself. Any Ideas?

  2. #2
    Guest
    Zip it into a WinZip SFX archive and have that extract it to the windows\system dir.

    About 40k overhead from the SFX, but that'll be made up by the compression.

    Gerco.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Texas
    Posts
    111

    Cool

    OK. So that is just a plain old self extracting file? Do I not have to register the OCX?

  4. #4
    Guest
    Yes, you have to register it...

    Just set "C:\Windows\system\regsvr32 something.ocx" as the command to execute when the unzipping is done.

    You might want to include the regsvr32.exe file, I'm unsure if it ships with windows...

    Gerco.

  5. #5
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    The RegSvr file is installed with windows, and is found under the system directory. This is normally "C:\windows\system\" for win9x installs, "C:\winnt\system32\" for windows NT installs.

    To be on the safe sie, use the GETSYSTEMDIRECTORY API call : http://www.vbapi.com/ref/g/getsystemdirectory.html to see where this is.

    Once you've found this, you then shell out to it and call on this program to register your file in the same line :
    Code:
    Shell Systemdir & "\regsvr32.exe /s Name_Of_OCX.ocx"
    Note that I included the /s switch, this registers the file silently. Normally, when you do this, you get a message box from windows telling you or the user if the register worked without any problems. This takes away that option.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Texas
    Posts
    111

    very cool

    That was going to be the next thing I looked at. We have a ton of NT and 98 machines. OK. So how do I go about creating this? Would it be a .vbs file or what?

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width