Results 1 to 5 of 5

Thread: Create shortcut problem. HELP!

  1. #1
    Guest

    Smile

    I have the following code inserted in my vb6 program

    Option Explicit

    'NOTE:
    'In Visual Basic 6.0 = Vb6stkit.dll

    Private Declare Function fCreateShellLink Lib "Vb6STKIT.dll" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long

    Private Sub cmdRegular_Shortcut_Click()

    Call fCreateShellLink("\Desktop", "Shortcut to Calculator", "c:\windows\calc.exe", "")

    End Sub

    An error occurs at the call fCreateShellLink. VB stated "Bad dll calling convention". Any ideas??? Thanks!


  2. #2
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633

    This one works for both Visual Basic 5 & 6.

    Code:
    Option Explicit
    
    'NOTE:
    'In Visual Basic 5.0 & 6.0 = Vb5stkit.dll
    'In Visual Basic 4.0       = Stkit432.dll
    
    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
    
    Private Sub cmdRegular_Shortcut_Click()
      'PURPOSE: Add to Startup Group
      'Note that on Windows NT, the shortcut will not actually
      'appear in the Startup group until your next reboot.
      Call fCreateShellLink("\Startup", "Shortcut to Calculator", "c:\windows\calc.exe", "")
      MsgBox "Shortcut of calculator has resided in \Startup"
      
      'PURPOSE: Add to Desktop
      'Call fCreateShellLink("..\..\Desktop", "Shortcut to Calculator", "c:\windows\calc.exe", "")
      
      'PURPOSE: Add to Program Menu Group
      'Call fCreateShellLink("", "Shortcut to Calculator", "c:\windows\calc.exe", "")
    End Sub
    Chemically Formulated As:
    Dr. Nitro

  3. #3
    Guest

    Wink Thanks!

    Thanks for the response, Nitro. I try the code but it still doesn't work. I look for the vb5stkit.dll on my system and couldn't find it. Do you know where I can get the file??

  4. #4
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633

    Talking

    That is very odd that it didn't work. Did you change Vb6STKIT.dll to Vb5STKIT.dll? Anyway, just go to yahoo and type Vb5STKIT in the search box.

    If you can't find it, send me an email and I will send you back the file, since you did not post your email.
    Chemically Formulated As:
    Dr. Nitro

  5. #5
    Guest

    Wink Here is my email...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width