Solved

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

Posted on 1998-07-01
8
183 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
ID: 1464697
Edited text of question
0
 
LVL 6

Accepted Solution

by:
clifABB earned 400 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

920 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

13 Experts available now in Live!

Get 1:1 Help Now