-
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?
-
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.
-
Cool
OK. So that is just a plain old self extracting file? Do I not have to register the OCX?
-
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.
-
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.
-
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!