CImageList in release ?? 
Author Message
 CImageList in release ??

i use VC++ 6.0  and i have a project with ATL/WTL.

the following code DO work fine in debug.

but, in relese, it DO NOT work.  

======================================================================
//  "imglist" is CImageList  and is public member of class "CMyView".

HINSTANCE hinst = _Module.GetResourceInstance();
HICON hIcon;

ATLASSERT( imglist.Create(16, 16, ILC_COLOR16|ILC_MASK, 1, 1) );

hIcon = ::LoadIcon(hinst, MAKEINTRESOURCE(IDI_ARROW0));

if (imglist.AddIcon(hIcon) == -1)                        //   <- runtime error in release
        MessageBox(_T("error"), _T(""), MB_OK);

=======================================================================

in debug mode, this code work well.

on the other hand,  why do not this code work in release ???

what is wrong ??

help me.

thanx.



Sat, 17 Jan 2004 03:07:04 GMT  
 CImageList in release ??
A VERY serious error in your source - you've put production code
in ASSERT!!!

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> i use VC++ 6.0  and i have a project with ATL/WTL.

> the following code DO work fine in debug.

> but, in relese, it DO NOT work.

> ======================================================================
> //  "imglist" is CImageList  and is public member of class "CMyView".

> HINSTANCE hinst = _Module.GetResourceInstance();
> HICON hIcon;

> ATLASSERT( imglist.Create(16, 16, ILC_COLOR16|ILC_MASK, 1, 1) );

> hIcon = ::LoadIcon(hinst, MAKEINTRESOURCE(IDI_ARROW0));

> if (imglist.AddIcon(hIcon) == -1)                        //   <- runtime
error in release
> MessageBox(_T("error"), _T(""), MB_OK);

> =======================================================================

> in debug mode, this code work well.

> on the other hand,  why do not this code work in release ???

> what is wrong ??

> help me.

> thanx.



Sat, 17 Jan 2004 04:35:29 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. CImageList doesn't work in release builds???

2. 4tH version 3.3d, release 2 released!

3. PRESS RELEASE: NilgiriHouse.com releases Dexter 1.0

4. Win32 Release MinDependency & Win32 Unicode Release MinDependency

5. CComPtr->Release() or CComPtr.Release()

6. Helps need on adding debug info to release mode so to debug release code

7. The difference between .Release and ->Release

8. Release of DCOM Lib before resource release

9. PRESS RELEASE: NilgiriHouse.com releases Dexter 1.0

10. Release Version: what files need to be released?

11. CImageList linking problem

12. CImageList in a ATL Property page

 

 
Powered by phpBB® Forum Software