Solved

VB5 Unexpected Error ?!?!?!?!

Posted on 1998-08-29
10
441 Views
Last Modified: 2008-03-03
I created a program a few days ago and distributed it to some of my friends online.  It works for me and most of my friends, but some of them can't run it, they get an "Unexpected Error" message, nothing else is said.  I sent them all the msvbvm50.dll and mswinsck.ocx.  Those are the 2 files I know I need.  So why would they be getting this unexpected error and not me or a lot of the others????
0
Comment
Question by:ChrisK
  • 5
  • 4
10 Comments
 
LVL 1

Expert Comment

by:Jason_G
ID: 1431824
Hi ChrisK,
What version of VB do you have, because if you have Professional or Enterprise, the easiest thing to do would be to use the Application Setup Wizard, to make a setup file for your app.  I'm not entirely sure what is causing the error, but it is most likely caused by the user not having your .dll's registered on their machine, which a setup program will do automatically.

You could use regsrv32.exe to register your files on their machine.

What exactly did you make?  An ActiveX control, Standard EXE, etc?

Perhaps, the reason it works on some of their machines and not others, is because they have VB installed?

Sincerely,
Jason

Jason Gorman (jason_gorman@scholars.com)
Learning Advisor, scholars.com
Microsoft Authorized Technical Education Center
Novell Authorized Online Training Provider
http://scholars.com
0
 
LVL 2

Author Comment

by:ChrisK
ID: 1431825
Well, these others don't have VB, so that's not it....I'm gonna make the setup wizard exe but how do I make it create a directory under programs for the program instead of just placing the icon under programs, and how about placing an icon directly on the desktop?
0
 
LVL 2

Accepted Solution

by:
percosolator earned 50 total points
ID: 1431826
I agree with Jason_g  (hey! that rhymes <g>)

Anyway, there's no telling what DLL's have been registered with your friend's computers. I have seen this in my experience, and it is nothing mystifying.

Use the Application Setup Wizard to include all necessary files, and send _that_ to them.  It will set-up everything necessary for your program to run.

Regards.
0
 
LVL 2

Author Comment

by:ChrisK
ID: 1431827
Great, I said I'd try that, but then answer my OTHER question then that ties in with the setup wizard.
0
 
LVL 1

Expert Comment

by:Jason_G
ID: 1431828
Hi Chris,
Just so I understand exactly where you want it, besides the desktop icon, can you write the directory, such as c:\myapp\

I'm not sure I quite understand where you want it to be placed.

Sincerely,
Jason

Jason Gorman (jason_gorman@scholars.com)
Learning Advisor, scholars.com
Microsoft Authorized Technical Education Center
Novell Authorized Online Training Provider
http://scholars.com
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Expert Comment

by:Jason_G
ID: 1431829
Hi Chris,
For now, here's an article from VB Books Online on Creating a Setup Program: Step by Step.

Whether you chose to create your setup with the Setup Wizard or by using the Setup Toolkit directly, there are certain steps that must be taken.
1.      Determine the files you need to distribute. The Setup Wizard automatically determines this information and then generates the Setup.lst file. In addition, for each ActiveX component or control that you create in Visual Basic for use in other projects, the Setup Wizard can create a dependency (.dep) file. All run-time files that are required by any ActiveX controls you used in your application, for example, are listed in this file. The .dep file will then be used by the Setup Wizard if your current project uses the ActiveX component or control created by that project. See "Dependency Files Explained" later in this chapter for more information.
2.      Create or write your setup program (Setup1.exe). The Setup Wizard creates the setup executable from the Setup Toolkit project. If you want to modify the default setup program, back up the Setup Toolkit project files and make changes as desired. You can rename this project as you see fit, as long as you change the Setup.lst to reflect the new name. See "Modifying the Setup Project" later in this chapter for information on customizing the Setup1.vbp project.
3.      Compress the appropriate files. The Setup Wizard compresses and copies the appropriate files to the distribution media. Some files (Setup.exe and Setup.lst) are copied to the distribution media uncompressed. If you use the Setup Toolkit, you’ll have to do the compression manually using Compress.exe. See "Compressing the Setup Files" later in this chapter for more information.
4.      If using disks, determine the disk layout. The Setup Wizard takes care of this automatically, determining the layout and notifying you of the number of disks needed. If you are using the Setup Toolkit, see "Determining the Layout of the Distribution Disks" later in this chapter for more information.
5.      Determine where to install the files on the user’s machine. Different types of files need to be installed to different directories on the user’s machine. For example, in Windows 95, setup and program files are usually installed to \Program Files\YourAppName, and system and dependency files are copied into the Windows\System directory. You can specify other paths in the Setup Wizard if you need to override the default settings. When using the Setup Toolkit directly, you will need to manually add this information to the Setup.lst file. See "Creating the Setup.lst File" later in this chapter for more information.
6.      Modify Setup.lst to include all the files on your list. The Setup Wizard automatically creates the Setup.lst for you, deriving this list from your application’s dependencies, program files, etc. When using the Setup Toolkit directly, you need to create this list manually. See "Creating a Setup.lst File" later in this chapter for more information.
7.      Create the distribution media. The Setup Wizard will prompt you for the type of media you want to use. You may select disks, a network server, or distribution via automatic code download from the Internet. You can also create distribution media manually. See "Creating Distribution Disks" and "Distribution Options" later in this chapter for more information.
8.      Test the setup program. Whether using the Setup Wizard or the Setup Toolkit, you should test your application’s setup prior to distribution. See "Testing Your Setup Program" later in this chapter for more information.
      
Advanced Features
Additionally, you may want to add advanced features to your setup program. Many advanced features are integrated in the Setup Wizard; however, you may need to modify some aspect of these features manually. The following list identifies these features and points you to the section within this chapter that discusses them in greater detail:
·      Create Internet component download packages. Use the Setup Wizard to create .cab files for the ActiveX components that you use in your Internet applications. See “Internet Component Download” later in this chapter for more information.
·      Install ActiveX components. Use the Setup Wizard to create setup programs for both the client and server in a Remote Automation or Distributed COM (sometimes called DCOM) environment. See “Installing Remote Automation and Distributed COM Components” later in this chapter for more information.
·      Install Data Access Components. If you used Data Access Objects (DAO) in your application, see “Installing Data Access Components” later in this chapter for more information on how to use the Setup Wizard to install them.
·      Distribute Your Application on a Network. The Setup Wizard gives you two options for installing your applications on a network. See “Distribution Options” later in this chapter for more information.

0
 
LVL 2

Author Comment

by:ChrisK
ID: 1431830
Simple, you click START then programs and ACCESSORIES for example is a directory / folder.  Most programs create their own folder for it to install to.  It already automatically puts it in program files, which I like, but what if I wanted to change that?  And then I want it to create a folder under programs to place the programs shortcut in, so it would be START\programs\myprogram\myprogram.exe.  And then how do I make it automatically put a shortcut to the program on the desktop in the install?
0
 
LVL 1

Expert Comment

by:Jason_G
ID: 1431831
Hi Chris,
You must manually edit the setup.lst file, that the setup wizard generates.  And this is the key you want to edit,

DefProgramGroup      - which specifies the default name of the Program Group (in Windows NT 3.51) or folder (in Windows 95 or Windows NT 4.0). Note that by default no folder is created for your application under Windows 95 or Windows NT 4.0. Instead, the program shortcut is created directly in the Programs menu of the Start menu.

To edit the setup.lst, just hold shift down, and right click on the setup.lst file, then choose notepad to open it.

Also, for other info, on changing setup options, just do a search for "setup.lst" in the VB Books Online.

I hope this helps.

Sincerely,
Jason

Jason Gorman (jason_gorman@scholars.com)
Learning Advisor, scholars.com
Microsoft Authorized Technical Education Center
Novell Authorized Online Training Provider
http://scholars.com
0
 
LVL 2

Author Comment

by:ChrisK
ID: 1431832
Ok we are 1 step closer now but still no go.  I put in for example:

DefProgramGroup=\MyStuff\theprogram.exe

that doesn't work...also tried

DefProgramGroup=MyStuff\theprogram.exe

And I don't see anything in the setup.lst that would automatically create a shortcut on the desktop AS WELL as putting the program in it's own shortcut folder.

0
 
LVL 1

Expert Comment

by:Jason_G
ID: 1431833
Hi Chris,
I believe, if you want any additional features not provided by the setup wizard (such as desktop icons, etc), you must access the setup toolkit, which is located in the program files\devstudio\vb\setupkit\ folder.  If you open an existing project with VB, and navigate to this folder, and open the setup1.vbp file, you will have access to all the code contained in the setup wizard, and here is where you would add any additional code commands.

Good luck!

Sincerely,
Jason

Jason Gorman (jason_gorman@scholars.com)
Learning Advisor, scholars.com
Microsoft Authorized Technical Education Center
Novell Authorized Online Training Provider
http://scholars.com
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

757 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

19 Experts available now in Live!

Get 1:1 Help Now