Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface
Go Back  Xtreme Visual Basic Talk > > > > Create Shortcuts with the IShellLinkA Interface


Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2004, 07:45 PM
OnErr0r's Avatar
OnErr0rCreate Shortcuts with the IShellLinkA Interface OnErr0r is offline
Obsessive OPtimizer

Administrator
* Guru *
 
Join Date: Jun 2002
Location: Debug Window
Posts: 13,774
Cool Create Shortcuts with the IShellLinkA Interface


This example contains a class wrapper which will allow you to easily create shortcuts. I originally attempted to use my IShellLink type library from vb6, but due to marshalling problems with LPSTRs, it was not useful. In creating this example I came across a bug in VB (by design they say) which will not allow it to create COM CoClasses as C# can, by using the ComImport Attribute. Make sure to complain to MS about this.

Enjoy!
Attached Files
File Type: zip Shortcut.zip (10.3 KB, 303 views)
Reply With Quote
  #2  
Old 08-03-2004, 10:14 AM
OnErr0r's Avatar
OnErr0rCreate Shortcuts with the IShellLinkA Interface OnErr0r is offline
Obsessive OPtimizer

Administrator
* Guru *
 
Join Date: Jun 2002
Location: Debug Window
Posts: 13,774
Default

I accidentally omitted marshalling for one of the IShellLinkA methods:

This line:
Sub GetWorkingDirectory(ByVal pszDir As StringBuilder, ByVal cch As Integer)

should actually be:
Sub GetWorkingDirectory(<Out(), MarshalAs(UnmanagedType.LPStr)> ByVal pszDir As StringBuilder, ByVal cch As Integer)

Thanks to forum user name: nighty for pointing that out.
__________________
Quis custodiet ipsos custodues.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent : Problem in Implementation of Interface? natrajv General 4 12-30-2003 07:15 AM
Callback interface using byte array MrVideo General 9 03-06-2003 11:07 AM
Frequently asked Interface Design questions Squirm Interface and Graphics 0 03-06-2003 09:40 AM
How do you create vb forms? shiatsu Interface and Graphics 2 12-28-2000 10:08 PM
Any way to make this easier? CornMaster General 7 10-24-2000 04:09 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface
 
Create Shortcuts with the IShellLinkA Interface
Create Shortcuts with the IShellLinkA Interface
 
-->