I've written an app that copies some files to an iPAQ. I just need to create a shortcut on the iPAQ that points to the executable I've installed. The rapi.dll that's part of ActiveSync includes a function called CeSHCreateShortcut. Microsoft's description: "This function creates a new shortcut on a remote Windows Embedded CE–based device." Just what I want to do. From the object browser:
Function CeSHCreateShortcut(lpszShortcut As String, lpszTarget As String) As Long
Member of RemoteCETypeLibrary.CERAPI
The CeSHCreateShortcut function creates a shortcut.
So I've got this declaration:
Public Declare Function CeSHCreateShortcut& Lib "rapi.dll" ( lpShortcut$, lpTarget$)
Used in this function:
Public Function RapiCreateShortcut(sShortcut$, sTarget$) As Boolean
lResult& = CeSHCreateShortcut(sShortcut$, sTarget$)
RapiCreateShortcut = (lResult& <> 0)
And I call it something like this:
RapiCreateShortcut "ShortcutName", "\Program Files\Unichip\Flux\Application.exe"
It says it's successful, but I get a file with unprintable characters in its name in root of the PDA. It's not a valid shortcut.
Could someone please point out where I'm going wrong? Thanks.