BUG: CImageList::ExtractIcon() fails without reason ! 
Author Message
 BUG: CImageList::ExtractIcon() fails without reason !

Hi all.
Anyone can Explain me why CImageList::ExtractIcon() fails ??
Try this...

void SomeFunc(void)
{
    CBitmap bm;
    bm.LoadBitmap(IDR_MAINFRAME); // The toolbar, for example ...

    CImageList imgList;
    imgList.Create(16, 15, TRUE, 0, 1);
    imgList.Add(&bm);

    while(TRUE)
    {
        ICONINFO iconinfo;
        HICON hIcon = imgList.ExtractIcon(1);
        if(!::GetIconInfo(hIcon, &iconinfo)) break;

        DestroyIcon(hIcon);    // This has no importance ...
    }

    DWORD err = GetLastError();    // You'll see err means INVALID HANDLE
...

Quote:
}

Thanks to all!


Wed, 21 Aug 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. System crashes without obvious reason

2. MessageBox autocloses "without" reason

3. CBitmap.LoadBitmap fails for no apparent reason

4. CImageList::Draw fails with larger images

5. CImageList::SetOverlayImage Fails

6. CImageList::Copy , WHY method FAIL ???

7. CImageList::SetBkColor() fails

8. CImageList::SetBkColor() fails

9. Q: CImageList::DragShowNolock fails

10. CImageList.Read bug?

11. BUG in CImageList.Attach() ?

12. Executable fails to run when moved to machine without VC++

 

 
Powered by phpBB® Forum Software