Running app w/o installing DLLs/OCXs/XYZs? ChrisLewis?

I've heard that it's possible to run a VB application without installing the required DLLs, _if_ those DLLs are in the same directory as the application file. Well, I've put all the files that SetupWizard includes in an install for the application in the same directory. And, surprise, surprise, it doesn't work... (And yes, I have "extracted" the install files...)

When I run the app, I first get two error messages saying "Object server not correctly registered". Then, when the application window appears, I get the same error with an additional "Run-time error '336':  " at the top. And then the application exits.

As indicated in the question title, the project uses OCXs.

Can anyone tell me if it's possible to get this to work, and if it is, how?

If you want to know what the point of not installing is, it's because the application reads data from a CD-ROM, and as long as you have to have the CD-ROM in the drive, it would be nice to be able to just skip the install... (And have an _optional_ App+Data install instead...)


Who is Participating?
This is both true and false (mostly false).

The application will run if the DLLs that are declared within the app are in the app directory.

The rest is a bit cloudy...
Back in the days of VB3 (and before) when the app was using VBXs, it was entirely possible to keep your specific VBXs (and their associated DLLs) in the app directory.  Many times there were several different versions of VBXs on one machine.  This was ok until developers started messing with the PATH system variable which put their VBX at the top of the list.  Version control went right out the window (so to speak) and users became frustrated when an application they just installed crashed previously installed and working apps.
Things changed with the advent of OCXs.  OCXs are registered in the registry.  This means that, whenever you install a new OCX, the old one is in effect replaced.  Windows95/NT's internal version control won't let an old version of an OCX register over a new version without express written consent of the user.
Also, OCX support files (DLLs) need to be in the same directory as the OCX.
MacSverreAuthor Commented:
Edited text of question
MacSverreAuthor Commented:
Hmm... First of all, I forgot to mention that the program has both Win95 and Win3.X versions.

Someone on #visualbasic/efnet told me about "regsvr32". I tried using that on the OCXs, but it didn't seem to do much good - it said it had registered the controls, but it still didn't work (actually, the win95 version gave another error message, "File not found", before I ran regsvr32). Can I make it work somehow with the help of regsvr32? More important, should I? (It seems to me that redefining the location of an already installed OCX to removable drive is not a very good idea...) Also, is there a "regsvr16"?
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

When using regsvr32 or regsvr16 (yes, there is one), you need to specify the complete path for the OCX.  Also, most OCXs I have seen have DLL support files which need to be in a location where the OCX can find them.  Usually this will be the same directory as the OCX.

As I said above, usually Win95/NT won't allow you to register an OCX over an existing newer version of the same OCX.  There will be exceptions, especially with OCXs without version information, but this will generally be the case.  What should happen is that the registration will go along without a problem, but the next time you boot Windows it will revert back to the original.

More important (good words), you should not do this.  Almost all OCXs are backwards compatible and those that aren't you shouldn't use.  If you keep the latest versions on your developement machine, there should not be a problem.  Also, if your could/did replace an older version of an OCX or DLL, you will find that your users will not be very happy when they try to run an application other than yours and find out it crashes because you replaced an necessary OCX/DLL.
MacSverreAuthor Commented:
OK, I'm gonna stop soon now...  :-)

If I re-register an OCX (on the CD) that's already installed on the PC, and Windows reverts back to the original on the next boot, it doesn't really matter, does it?

But isn't there a way to check if an OCX is installed? Like "LVAR_goobledygook_IS_OCX_INSTALLED( byval doop as string) as BOOLEAN"?

   MacSverre, grasping for straws... :-)
As far as telling if an OCX is installed (registered) you could look in the registry, but this would be very difficult as you would need to know the classid (or search through all the classids).

In a nutshell, you might as well go through the install routine.  If you're looking for speed in installing, most setup routines won't copy an older (or current) version OCX on top of a newer (or current) OCX.  They can't tell if the OCX is registered or not, though.
MacSverreAuthor Commented:
Speed of installation is not really the issue. I would just prefer to be able to run the program without installing anything at all.

Anyway, I understand it`s not practical now... Thanks to you!!!  :-) You deserve the 400 points for bearing with a slow-minded one...  :-)
I wouldn't call you that.  You do have some very valid questions and ideas.  Perhaps one day...

Thanks for the points.  :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.