Google 网上论坛不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

IShelllink->Resolve shortcuts is drive A

已查看 39 次
跳至第一个未读帖子

Jim Barry

未读,
2004年3月3日 06:23:072004/3/3
收件人
Cecil Sheng wrote:
> I am trying to resolve a shortcut whose target is at drive A( ex: a:\test.exe). When there is no diskette in drive A, an error dialog will pop, saying "No disk in drive A".
> I've tried set SLR_NO_UI, or passing a NULL hWnd when calling IShellLink -> resolve, but all fails.
> What else can i do?

This "hard error" is is coming from deeper within the system. If you look in the system event log, you will also see these error messages listed there. You can prevent the popups from appearing by calling SetErrorMode with the SEM_FAILCRITICALERRORS flag.

--
Jim Barry, MVP for Windows SDK

anon...@discussions.microsoft.com

未读,
2004年3月7日 21:08:302004/3/7
收件人
However, I tried not to Resolve it before GetPath and it
seems to work fine. I am wondering what's Resolve doing,
and is it neccessary to Resolve first?

--Cecil.

Bill Pytlovany

未读,
2004年3月7日 23:26:082004/3/7
收件人
Thanks Cecil and Jim.
This is very close to an issue I've been dealing with for a long time and never really understood where the error was coming from. I wasn't happening a lot but would occur when users had a program in their startup folder that pointed to a location that no longer existed.

Your question and response triggered my brain and sure enough solved our problem just in time for our newest version which was launched today.

Thanks!
Bill Pytlovany
WinPatrol 7.0


Rhett Gong [MSFT]

未读,
2004年3月8日 04:43:112004/3/8
收件人
Hi Cecil,
Please check the Remarks section of IShellLink::Resolve Method for
what Resolve is doing:
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/shellcc/platform/shell/reference/ifaces/ishelllink/Resolve.asp .

Have a nice day!
Rhett Gong [MSFT]
Microsoft Online Partner Support

This posting is provided "AS IS" with no warranties, and confers no
rights.
Please reply to newsgroups only. Thanks.


Rhett Gong [MSFT]

未读,
2004年3月10日 20:33:382004/3/10
收件人
Resolve has two approaches to finding target objects. The first is the distributed link tracking service. If the
service is available, it can find an object that was on an NTFS version 5.0 volume and was moved to
another location on that volume. If distributed link tracking is not available or fails to find the link object,
Resolve attempts to find it with search heuristics. It first looks in the object's last known directory for an
object with a different name but the same attributes and file creation time. Next, it recursively searches
subdirectories in the vicinity of the object's last known directory.

In additional, when we call IShellLink:: Resolve with SLR_NO_UI flag set, pass NULL to hwnd parameter.
You can see a message dialog will not be popup when the resolving failed.

0 个新帖子