Re: Create a shortcut in SendTo menu



I can't agree at all with your recommendation. Under NO circumstances
whatsoever would I want my app dependent on VB's Setup Toolkit DLL. And the
one you're mentioning is from VB4 (although it should work in a VB5/6 app).

A MUCH better alternative is to use the IShellLink interface. There's an
unsupported example program included with VB that shows how to use it. It
includes a type library that exposes the interface for use in VB. There are
no dependencies and nothing extra to distribute (because the interface is
part of Windows; you just need the type library to expose the interface
within the VB IDE). Plus, you have so much more functionality than what
fCreateShellLink offers. For example, you can create the shortcut anywhere
you want (fCreateShellLink can only create shortcuts in specific folders off
the Start Menu [granted, you can specify a path relative to the Start
Menu\Programs folder, but that gets messy]). You can also edit an existing
shortcut or just get any of the shortcut's properties if you just need to
know what they are.

Look on your VB CDs. Which CD depends on whether you have VB or VS and
which edition you have. I believe the example is only included with the
Pro/Ent editions, though. The project file name you're looking for is
"SHELLLNK.VBP" and should be in a folder similar to
"M:\COMMON\TOOLS\VB\UNSUPPRT\SHELLLNK". Now, I have VS Ent and this folder
is on disc 3. As I said, where you'll find it will vary, so the easiest way
is to just search via Windows Explorer for the project file name.

Eduardo Morcillo also has a type library that exposes the IShellLink
interface that you could use instead. It can be downloaded fromr here:

http://www.mvps.org/emorcillo/en/code/vb6/index.shtml

(it's the OLELIB.TLB file; GREAT file to have by the way since it exposes a
LOT of functionality to VB)

For documentation on the IShellLink interface, consult MSDN Library:

http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/ifaces/ishelllink/ishelllink.asp


--
Mike
Microsoft MVP Visual Basic





"Ted" <2000@xxxxxxxxxx> wrote in message
news:%23l4qn8Q$FHA.740@xxxxxxxxxxxxxxxxxxxxxxx
> Never had a problem distributing or running STKIT432.DLL, there
> is only two versions released, it is a must have.
>
> "arno" <rNOSPAMnospam@xxxxxxxxx> wrote in message
> news:3c0kp1dvl9u3ktkuah5a237ucdl3rmbvm4@xxxxxxxxxx
>> Okay, that requires a dependency on a file. I'd rather not have to do
>> that; it is a sure way of getting into trouble when distributing the
>> app. Given a choice, I'd rather stick with a dependency on the WSH.
>>
>> Tx for your input, tho, it was very useful,
>> arno
>>
>> On Fri, 9 Dec 2005 13:49:45 -0800, "Ted" <2000@xxxxxxxxxx> wrote:
>>
>>>You need to distribute STKIT432.DLL with your app.
>>>
>>>Private Declare Function fCreateShellLink Lib "STKIT432.DLL" (ByVal
>>>lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal
>>>lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long


.



Relevant Pages

  • Re: Frustrating COM+/Remoting Service Issue
    ... I did load up fuslogvw and it doesn't show any resolve errors. ... assemblies, the COM interop and interface assemblies, and it is calling ... a method that returns a string to see if that works and narrow down the ... >COM+ app, it is running as part of the prcess of that app. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Create a shortcut in SendTo menu
    ... I'd rather stick with a dependency on the WSH. ... >You need to distribute STKIT432.DLL with your app. ... >lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal ...
    (microsoft.public.vb.general.discussion)
  • Re: graph of behavior - was Re: State vs. Data (was Re: Fans of Template Method with protected varia
    ... > interface, I can invert the dependency between two packages without ... > In this case package a depends upon package b. ... "Uncle Bob" sycophant terms for using abstract interfaces to concrete ...
    (comp.object)
  • Re: COM Question
    ... interface (or base class - it doesn't have to specifically be an ... Each new object will reference this same DLL to get the ... Your "consumer" app also references the original base that holds the ...
    (microsoft.public.dotnet.framework.compactframework)
  • In desperate need of COM interop help
    ... provide the other applicaiton with an interface to my classfor storing ... data, and when this other app uses COM to call my exposed methods, I will ... will get the interface I expose, and send the data over to me. ... Populate1(); ...
    (microsoft.public.dotnet.languages.csharp)