|
-
February 16th, 2004, 07:23 AM
#1
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.
I am Miss Maiden... Miss Iron Maiden :-D
-
February 16th, 2004, 07:29 AM
#2
No, I don't know why.
What error value does ShellExecute return?
You say it works on same machines... is this maybe a problem with user-rights (logon with a user the belongs to the local admin group).
-
February 16th, 2004, 07:35 AM
#3
Thank you for your answer!
Well, I don't know what is the error, because I don't have the machine, and on my machine works 
Moreover, if you do double-click in the lnk file from explorer, it works, but not from code. And I suppose user-rights are the same in both cases, aren't they?
I am Miss Maiden... Miss Iron Maiden :-D
-
February 17th, 2004, 03:19 AM
#4
More info:
We have tested in 3 XP machines:
1.- It works.
2.- ShellExecute doesn't return any error, but it doesn't open the file.
3.- ShellExecute returns an error, I know it because the error message is shown, but I don't know how is the error.
And in the 3 cases the file can be opened from Windows Explorer.
Any ideas?
I am Miss Maiden... Miss Iron Maiden :-D
-
April 11th, 2005, 10:15 PM
#5
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
-
April 12th, 2005, 01:09 AM
#6
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().
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|