ShellExecute & XP & lnk files
Hi!
This is my code:
Code:
if (::ShellExecute(NULL, "open", sPath, NULL, NULL, SW_SHOWNORMAL) <= (HINSTANCE)32)
{
ShowError(IDS_ERROR_OPEN_FILE, sPath);
bRetcode = FALSE;
}
In windows 95/98/NT/2000 works perfectly. In XP fails when sPath is a lnk file. But only in some machines with XP. Anybody know why?
Thank you in advance.
Re: ShellExecute & XP & lnk files
I found this post. I am having the same problem with a program of mine. A user reported the error and I was able to reproduce it on my XP SP2 machine but on another it does not happen. I am sure that it used to not happen on this machine either. On another XP just upgraded to SP2 machine it does not happen.
Has anyone found a solution. The cause seems like it may be an update to windows, or at least that seems like the next logical thing to look into.
I'd appreciate any information you can provide.
Thanks,
Jon Kuhn
Re: ShellExecute & XP & lnk files
One selution is to resolve the lnk and pass the real path to ShellExecute.
And use ShellExecuteEx instead to GetLastError().