Solved

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

Posted on 1998-07-01
8
182 Views
Last Modified: 2010-05-03
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...)



Regards,

   MacSverre
0
Comment
Question by:MacSverre
  • 4
  • 4
8 Comments
 
LVL 2

Author Comment

by:MacSverre
Comment Utility
Edited text of question
0
 
LVL 6

Accepted Solution

by:
clifABB earned 400 total points
Comment Utility
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.
0
 
LVL 2

Author Comment

by:MacSverre
Comment Utility
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"?
0
 
LVL 6

Expert Comment

by:clifABB
Comment Utility
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.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Author Comment

by:MacSverre
Comment Utility
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... :-)
0
 
LVL 6

Expert Comment

by:clifABB
Comment Utility
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.
0
 
LVL 2

Author Comment

by:MacSverre
Comment Utility
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...  :-)
0
 
LVL 6

Expert Comment

by:clifABB
Comment Utility
I wouldn't call you that.  You do have some very valid questions and ideas.  Perhaps one day...

Thanks for the points.  :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now