Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem #2 with my program on a network 1

Status
Not open for further replies.

mathprof

Programmer
Nov 8, 2000
37
US
Hi,
My program works on some workstations but gives errors on others. For example:

error 50003

error 481 (invalid picture)
I use "savepicture" with a bitmap
Which (VB6) DLL is used with bitmaps?

I suspect that it has to to with DLL/OCX files which are missing or outdated at the workstation.

Has anyone experienced similar errors and if so, how did you remedy the situation.

Should I have my program install ALL dll's in the app directory on the server? Would this help?

Thanks.
Prof Weissman
 
Did you add any components to your project? In other words did you select from the main menu Project --> Components and then add a Control? If so, then this OCX and dependent DLL's need to be included with the application. Ahhh something just occured to me.

How are you putting the application on the remote machines? Are you just copying the EXE to them? No wait, let me see if I can put this together.

You installed the application on the server machine and then created a shortcut on each of the workstations to point to the EXE on the server. If that's what you did, you're going to get mixed results as you're seeing.

In regards to your other posts about the searching order of the DLL's, it's all starting to come together. You need to create a setup program that installs your application.

Let me give you an example, of how this works.. Let me first state that Visual BASIC has its own set of dependent files that have to be present on the machine before you can continue. I'll explain this using an add-on component and you can apply it to how Visual BASIC works.

Assume that you use Crystal Reports in your application. Crystal Reports is a reporting engine that allows you to create nice reports for your application. CR has a set of DLL's and OCX's that must be installed and registered on the machine that the application is running on. If you just copy the EXE to the machine, chances are the DLL's and OCX's are not on that machine and you'll get ActiveX object creations errors all over the place if it even runs at all. Remember, Visual BASIC needs its own set of DLL's in order to run. These may or may not be on the client machine.

One other thing I want to touch on is that just copying the DLL's to the application directory won't make it run either. Especially if there are DLL's that need to be registered.

Your job is to make sure that all the Visual BASIC run-time files are on the client machine along with any dependent OCX's or DLL's used by your application. How do you do this? I'm glad you asked.

Visual Studio 6.0 ships with a program called the "Package & Deployment Wizard". This application will assist you in collecting most of the files needed for your application to be installed on another machine. In fact it does most of the work for you. It has its drawbacks too, but for the most part it's a pretty good tool.

If you have any files that need to be included in your applcaiton, such as the password file you mentioned in one of your other posts, you might need to add that manually to the setup. There is a place to do this in the wizard. Also in my Crystal Reports example, if you had created any reports, you would have to manually add those since the P&DW doesn't know what reports your program uses.

Once you get the setup progrm built, it needs to be installed on each of the workstations. I would say that you don't even need to install it on the server unless you want to be able to run the application from the server. Just install it on each workstation and point the install directory to the shared directory on the server for EVERY workstation you install it on. This will automatically create your shortcut on the client machine and the setup program will install the correct OCX's and DLL's on every client machine. Do this if you want to have one place for the EXE for all the workstations. This has some advantages. First if you ever fix bugs in the EXE, all you have to do is copy the EXE to the server and all the clients will automatically use it. However, if you add a new component to the EXE where it creates a new dependency, then you would have to run a new setup on each one of the machines to be sure the dependent files were installed on them. After all that if all goes well, you'll be able to run the application from any machine with no problems.

This does not address the issue of two names showing up on different machines. See that particular post about how to track down that problem. Snaggs
tribesaddict@swbell.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top