-
January 17th, 2013, 09:34 AM
#1
Wrong IID_IExtractIcon
Hi,
I've implemented IShellFolder and IExtractIcon. In IShellFolder I have the following code
Code:
STDMETHODIMP CILCShellFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *rgfReserved, void **ppv){
ATLTRACE(_T("CILCShellFolder::GetUIObjectOf\n"));
HRESULT hr;
//if(riid == IID_IExtractIcon){
if(IsEqualIID(riid, IID_IExtractIcon)){
CComObject<CILCExtractIcon>* extractIcon;
hr = CComObject<CILCExtractIcon>::CreateInstance ( &extractIcon );
extractIcon->AddRef();
//extractIcon->Init((IShellFolder*)this);
extractIcon->QueryInterface( IID_IExtractIcon, (void**)ppv);
extractIcon->Release();
return hr;
}
return E_NOTIMPL;;
}
The problem is that my IExtractIcon implementation is never called because the riid of GetUIObjectOf always is IID_IExtractIconA. I thought that IID_IExtractIcon is set depending you have a Unicode or ANSI dll. Everything is set to Unicode for the project. So as long as I do not check for IID_IExtractIconA it's not working. What's the problem?
Kind regards,
Michael
-
January 18th, 2013, 09:34 AM
#2
Re: Wrong IID_IExtractIcon
the thing is that YOU don't decide which of the 2 versions get called. The application that tries to use the IShellFolder does.
You need to provide both a ansi and unicode version of the IExtractIcon (or live with the fact that your code will only work when someone requests one of them).
-
January 18th, 2013, 12:40 PM
#3
Re: Wrong IID_IExtractIcon
the application is the windows explorer in windows 7, does it ask for IID_IExtractIconA? Example of IExtractIcon implementations I can find just do
Code:
if(riid == IID_IExtractIcon){
...
}
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
|