Home » U++ Library support » U++ Core » Symlink/Shortcut support
Re: Symlink/Shortcut support [message #24939 is a reply to message #24938] |
Fri, 05 February 2010 10:25   |
 |
mirek
Messages: 14256 Registered: November 2005
|
Ultimate Member |
|
|
Please check my altered version:
String GetSymLinkPath(const char *linkpath)
{
#ifdef PLATFORM_WIN32
String path;
HRESULT hres;
IShellLink* psl;
IPersistFile* ppf;
CoInitialize(NULL);
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink,
(PVOID *) &psl);
if(SUCCEEDED(hres)) {
hres = psl->QueryInterface(IID_IPersistFile, (PVOID *) &ppf);
if(SUCCEEDED(hres)) {
hres = ppf->Load(ToSystemCharsetW(linkPath), STGM_READ);
if(SUCCEEDED(hres)) {
char fileW[_MAX_PATH] = {0};
psl->GetPath(fileW, _MAX_PATH, NULL, 0);
path = FromSystemCharset(fileW);
}
ppf->Release();
}
psl->Release();
}
CoUninitialize();
return path;
#else
char buff[_MAX_PATH + 1];
bool ret;
int len = readlink(linkPath, buff, _MAX_PATH);
if(len > 0 && len < _MAX_PATH)
return String(buff, len);
return Null;
#endif
}
(now in U++, thanks).
|
|
|
 |
|
Symlink/Shortcut support
By: koldo on Mon, 01 February 2010 08:02
|
 |
|
Re: Symlink/Shortcut support
By: mirek on Mon, 01 February 2010 14:42
|
 |
|
Re: Symlink/Shortcut support
By: koldo on Mon, 01 February 2010 15:49
|
 |
|
Re: Symlink/Shortcut support
|
 |
|
Re: Symlink/Shortcut support
By: koldo on Mon, 01 February 2010 16:24
|
 |
|
Re: Symlink/Shortcut support
By: fudadmin on Mon, 01 February 2010 21:40
|
 |
|
Re: Symlink/Shortcut support
By: mirek on Mon, 01 February 2010 22:29
|
 |
|
Re: Symlink/Shortcut support
By: mirek on Fri, 05 February 2010 10:22
|
 |
|
Re: Symlink/Shortcut support
By: mirek on Fri, 05 February 2010 10:25
|
 |
|
Re: Symlink/Shortcut support
By: koldo on Fri, 05 February 2010 11:42
|
 |
|
Re: Symlink/Shortcut support
By: mirek on Sat, 06 February 2010 12:49
|
 |
|
Re: Symlink/Shortcut support
By: mirek on Sat, 06 February 2010 13:20
|
 |
|
Re: Symlink/Shortcut support
By: koldo on Sat, 06 February 2010 14:30
|
 |
|
Re: Symlink/Shortcut support
By: mirek on Sat, 06 February 2010 19:40
|
 |
|
Re: Symlink/Shortcut support
By: koldo on Sat, 06 February 2010 23:13
|
 |
|
Re: Symlink/Shortcut support
By: mirek on Sat, 06 February 2010 23:19
|
 |
|
Re: Symlink/Shortcut support
By: mirek on Sat, 06 February 2010 23:26
|
Goto Forum:
Current Time: Sat May 03 01:53:06 CEST 2025
Total time taken to generate the page: 0.00776 seconds
|