Hello Will,
I try the example for creating the shortcut file. but the following function
return fail.
Can you tell me the reason?
hres = CoCreateInstance(CLSID_ShellLink, NULL,
CLSCTX_INPROC_SERVER,IID_IShellLink, (LPVOID*)&psl);
Thanks
>> How to create a Shortcut File by programming in C++?
>> To use whitch function or Windows API?
[quoted text clipped - 6 lines]
> Regards,
> Will
William DePalo [MVP VC++] - 28 Jan 2005 05:41 GMT
> I try the example for creating the shortcut file. but the following
> function return fail.
> Can you tell me the reason?
>
> hres = CoCreateInstance(CLSID_ShellLink, NULL,
> CLSCTX_INPROC_SERVER,IID_IShellLink, (LPVOID*)&psl);
Here is a tip for some self-help: take a look at the value of hres in the
watch window. Then plug that value into the error lookup tool from the menu
to see the text of the message.
Did you remember to call CoInitialize[Ex]()?
Regards,
Will
Ping - 28 Jan 2005 06:03 GMT
Hi Will,
Yes, i'm missing to call CoInitializeEx(...).
Now it's OK!
Thank you very much
>> I try the example for creating the shortcut file. but the following
>> function return fail.
[quoted text clipped - 11 lines]
> Regards,
> Will