• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

Why are bitmaps displayed in a debug version of a program but not in the release?

Why are bitmaps displayed in a debug version of a program but not in the release?

1. I have an Active X control.
2. It uses AFX_MANAGE_STATE to get hold of the bitmaps from its own resource.
3. The bitmaps are loaded into an image list and displayed in a CListCtrl.
4. The bitmaps are displayed in the debug version of the program
5. The bitmaps are NOT displayed in the release.

Thanks in advance
Yakky
0
yakky
Asked:
yakky
  • 4
  • 3
  • 2
  • +2
1 Solution
 
WynCommented:
Too high level
0
 
inprasCommented:
We appreciate some code here....!!!
0
 
ShaunWildeCommented:
without source we can only guess - however here as a suggestion

Unintialized variables - debug has a habit of initializing variables to 0 - however in release theses variables could have any value. Make sure all your variables have the values set to what you want them to be don't assume the compiler will.
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
mikeblasCommented:
>  debug has a habit of initializing variables to 0

No, it doesn't.  An uninitialized variable is an unintialized variable. If you find one that has any particular value more often than another, you're just lucky.

(Unless you're using the /GZ compiler switch.)

..B ekiM
0
 
ShaunWildeCommented:
> (Unless you're using the /GZ compiler switch.)

oops I did mean 0xCC which I think is the /GZ option (standard company option for debug here)

must remember not to rush posts b4 going home :)

0
 
yakkyAuthor Commented:
Ive got the bitmaps to display, I simply removed the ASSERT statement.
0
 
ShaunWildeCommented:
ahh - did you by any chance have useful code in the assert?
0
 
mikeblasCommented:
> I simply removed the ASSERT statement

What ASSERT statement? You haven't mentioned any ASSERT statements until now.

..B ekiM
0
 
yakkyAuthor Commented:
The ASSERT was on the CImageList Create function. Prety dumb really. Thanks for everyones help. By the way why did it work in the Debug and not in the Release?

Yakky
0
 
ShaunWildeCommented:
in release ASSERT is define as

#define ASSERT(f)          ((void)0)

which means that 'f' never gets executed

you should have used VERIFY instead which works the same as ASSERT in debug but in release it is defined as

#define VERIFY(f)          ((void)(f))

so 'f' does get executed

PS now you know why we wanted to see the code as this wuld have been spotted straight away (I hope) as it is a common gotcha (sic)
0
 
yakkyAuthor Commented:
Thanks for everyones help
Yakky
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now