Wrong IID_IExtractIcon
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Wrong IID_IExtractIcon

  1. #1
    Join Date
    Dec 2011
    Posts
    44

    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

  2. #2
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    3,920

    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).

  3. #3
    Join Date
    Dec 2011
    Posts
    44

    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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center