🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
6 messages
6 total messages Started by Jos� Fri, 21 Apr 2006 09:15
Resolving a shortcut
#3845
Author: Jos�
Date: Fri, 21 Apr 2006 09:15
4 lines
892 bytes
I read a file with the LNK extension. How to find the file it refers
to?
-- 
Jos�
Re: Resolving a shortcut
#3849
Author: Remy Lebeau (TeamB)
Date: Fri, 21 Apr 2006 10:04
15 lines
1357 bytes
"Jos�" <jose@127.0.0.1> wrote in message
news:tk8h4252vqq8t5t08lkfpc9k20tb0gubom@4ax.com...

> I read a file with the LNK extension. How to find the
> file it refers to?

Use the IShellLink interface to read/write .lnk files:

    Shell Links

http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/shortcuts/shortcut.asp


Gambit
Re: Resolving a shortcut
#3858
Author: Jos�
Date: Sat, 22 Apr 2006 15:54
30 lines
2270 bytes
On Fri, 21 Apr 2006 03:04:14 -0700, "Remy Lebeau \(TeamB\)"
<no.spam@no.spam.com> wrote in borland.public.cppbuilder.nativeapi:

>> I read a file with the LNK extension. How to find the
>> file it refers to?
>
>Use the IShellLink interface to read/write .lnk files:
>
>    Shell Links
>
>http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/shortcuts/shortcut.asp

It's pretty complicated. I am surprised that there is no such thing as
a simple function: String ResolveShortCut (String lnkfile);

Besides, I may be a dunce, but the function ResolveIt on the website
doesn't compile:

(190): E2451 Undefined symbol 'IShellLink'.
(198): E2268 Call to undefined function 'CoCreateInstance'.
(198): E2451 Undefined symbol 'CLSID_ShellLink'.
(199): E2451 Undefined symbol 'IID_IShellLink'.
(202): E2451 Undefined symbol 'IPersistFile'.
(205): E2451 Undefined symbol 'IID_IPersistFile'.
(218): E2451 Undefined symbol 'STGM_READ'.
(231): E2451 Undefined symbol 'SLGP_SHORTPATH'.
(240): E2268 Call to undefined function 'StringCbCopy'.
(248): E2268 Call to undefined function 'HandleErr'.
-- 
Jos�
Re: Resolving a shortcut
#3863
Author: Hans Galema
Date: Sun, 23 Apr 2006 07:19
13 lines
1345 bytes
Jos� wrote:

> It's pretty complicated. I am surprised that there is no such thing as
> a simple function: String ResolveShortCut (String lnkfile);

Then why not write your own ?

If you open a .lnk file in notepad you can see that the requested
path is behind 'Data '.

Knowing that, you can extract it.

Hans.
Re: Resolving a shortcut
#3866
Author: Jos�
Date: Sun, 23 Apr 2006 11:52
15 lines
1417 bytes
On Sun, 23 Apr 2006 09:19:31 +0200, Hans Galema <notused@notused.nl>
wrote in borland.public.cppbuilder.nativeapi:

>> It's pretty complicated. I am surprised that there is no such thing as
>> a simple function: String ResolveShortCut (String lnkfile);
>
>Then why not write your own ?
>
>If you open a .lnk file in notepad you can see that the requested
>path is behind 'Data '.

Sure, I have already programmed lots of functions without knowing that
they already existed.
-- 
Jos�
Re: Resolving a shortcut
#3788
Author: Remy Lebeau (TeamB)
Date: Mon, 24 Apr 2006 18:26
29 lines
1963 bytes
"Jos�" <jose@127.0.0.1> wrote in message
news:rtjk42t6426h38shott0522k1on8evq50r@4ax.com...

> It's pretty complicated.

Welcome to Shell programming.  Most things in the Windows Shell is exposed
as COM interfaces.

> I am surprised that there is no such thing as a simple function: String
ResolveShortCut (String lnkfile);

The article I pointed you to has the code for such a function.

> Besides, I may be a dunce, but the function ResolveIt on
> the website doesn't compile:

Works fine for me.  You probably did not include shlobj.h into your code.

Note that for shlobj.h, if you are using BCB 5 or higher, you need to add
NO_WIN32_LEAN_AND_MEAN to the Conditionals list in the Project Options.

Note also that StringCbCopy() is declared in strsafe.h, which is not shipped
with BCB at all.  So you will have to download the latest Borland Platform
SDK from http://bccsdk.sourceforge.net in order to use it.  Otherwise, use
strncpy() instead


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads