Shortcut Question for VB6
I have the following code for creating a shortcut
VB Code:
Private Declare Function fCreateShellLink Lib "VB5STKIT.DLL" _
(ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, _
ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
dim result as long
Result = fCreateShellLink("..\..\Desktop", ShortCutName, App.Path & "\exename.exe", (properties))
For the desktop shortcut path which is "..\..\Desktop" it works fine on my computer, but when I try to run the program on another system it doesnt put a shortcut on the desktop. Everything else works but the shortcut on the desktop so I tried to use an exact path such as "C:\Docume~1\Administrator\Desktop\" and then it doesnt even work on my computer. Anyone have any idea how to fix this so that it works on other computers and I can be exact as to where the shortcut is put?
Thanks,
jd
Re: Shortcut Question for VB6
remember, you need VB5STKIT.DLL on all computers it is installed on!
put it in the system folder or system32 folder (dont remember) and type
regsrvr vb5stkit.dll
Re: Shortcut Question for VB6
ah crap. ok well thanks a ton. I guess I gotta go with the longer code for shortcut :( How to we make these resolved btw?
Re: Shortcut Question for VB6
why cant you just send him the dll? obviously you have it!
to resolve edit the first post
Re: Shortcut Question for VB6
You need to create an installation package in order to be sure your app will run on other people's PCs.
Re: Shortcut Question for VB6
Quote:
Originally Posted by |2eM!x
remember, you need VB5STKIT.DLL on all computers it is installed on!
put it in the system folder or system32 folder (dont remember) and type
regsrvr vb5stkit.dll
You need a lot more than that!!! This info is constantly repeated nausously. If you use an Installer it will do that for you.
Re: Shortcut Question for VB6
what more do you need than that?
Re: Shortcut Question for VB6
|2eM!x,
At least all of the VB6 Runtime files. Then if you included some references... some more files. Take a peek at some of the post in the forum. There are a slew of Noobie post on the very same subject of basically copying file to another computer for their apps to run.
If you get by with less it is just pure luck and it will run out!
In fact he should not even be using the VB5 dll he is using.
Re: Shortcut Question for VB6
i have never ever needed to package any of that stuff. Almost everyone has the vb runtime files, and i just add the .dlls in a folder with a bat that registers them..
if you dont have the vb runtime files, use google, its what its for..
you dont need a bogus package that will just take up more space...
..
also, what happends when the user already has the files? theyve then just been forced to download and extra how many megabytes?
Re: Shortcut Question for VB6
|2eM!x,
Wake up :eek: . This is the information age a few megabytes??? Anyway most people don't make apps that simple as to where there are only a few things that need to be deployed.
Running a red light five times without an incident does not mean that runnng red lights is SAFE and the way it should be done.
Re: Shortcut Question for VB6
no offense, but how do you know this is the way it "should" be done?
Re: Shortcut Question for VB6
|2eM!x,
If you actually read many of the post on this site (or even this forum)... you would not have to ask that question.
Re: Shortcut Question for VB6
i think this is more of an opinion rather than a fact...
Re: Shortcut Question for VB6
|2eM!x,
You are entitled to your option, however wrong it may be. But reading should cure that. Wrong options can be cured however other things cannot.
Re: Shortcut Question for VB6
|2eM!x,
You might even want to read this.
Re: Shortcut Question for VB6
|2eM!x, you said yourself :
Quote:
Almost everyone has the vb runtime files
Keyword is almost... Won't you want to be sure that it works for everyone? Cause then it's extra trouble for them to find and download the vb runtimes... Plus, what is 1 more megabyte (I think that's how much the vb runtimes are)? Even for dial-up that I have? ;)
Re: Shortcut Question for VB6
well, i hate downloading more crap than i need. like on my installer for my modem, its got like a 500mb file on there that is not needed..i had to send that whole thing to my other computer until i realized that it wasnt needed...(my other comp dont have a cd drive :blush: )
Re: Shortcut Question for VB6
Quote:
500mb file on there that is not needed
Who makes the modem, what kind of driver is it?
Who deemed it not necessary?
And, how long does it take to xfer a file over the network?
Re: Shortcut Question for VB6
As already posted a few times in this thread, in order to be sure your program will run on any other system you NEED to create
an installation package.
If your concerned about file sizes then you need to optimize the way you write your apps. Do not use controls when you
can use APIs to recreate them instead of using the ocxs, draw your graphics (where possible) instead of adding images to a
resource file, dynamically load your controls instead of having allot of controls added in design view of your forms, etc.
The use of APIs will help reduce your dependancies on other files. Most APIs are dependant upon the user32.dll, gdi32.dll,
advapi.dll, etc which are part of the core of Windows. Windows can not run without these and are included in every single
Windows installation from 3.1 and NT 3.51 to present.
Here are a couple of CodeBank links for creating a shortcut. You can incorporate them into your program or if you
use an installer then you can modify the P&D wizard to do it or use any of the other free installers in this forums FAQ. :)
http://www.vbforums.com/showthread.php?t=234891
http://www.vbforums.com/showthread.php?t=272224
http://www.vbforums.com/showthread.php?t=322799
http://www.vbforums.com/showthread.php?t=231660
http://www.vbforums.com/showthread.php?t=269582
http://www.vbforums.com/showthread.php?t=277370
End of off topic discussions please. This thread was about creating a shortcut.