?
Solved

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

Posted on 1998-07-01
8
Medium Priority
?
189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 2

Author Comment

by:MacSverre
ID: 1464697
Edited text of question
0
 
LVL 6

Accepted Solution

by:
clifABB earned 1600 total points
ID: 1464698
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
ID: 1464699
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:clifABB
ID: 1464700
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
 
LVL 2

Author Comment

by:MacSverre
ID: 1464701
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
ID: 1464702
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
ID: 1464703
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
ID: 1464704
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

770 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