Click here to Skip to main content
15,917,971 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: STL and UNICODE Pin
Michael Dunn2-Jul-01 18:52
sitebuilderMichael Dunn2-Jul-01 18:52 
GeneralRe: STL and UNICODE Pin
Nick Blumhardt2-Jul-01 19:11
Nick Blumhardt2-Jul-01 19:11 
GeneralRe: STL and UNICODE Pin
2-Jul-01 21:30
suss2-Jul-01 21:30 
GeneralRe: STL and UNICODE Pin
3-Jul-01 5:02
suss3-Jul-01 5:02 
GeneralRe: STL and UNICODE Pin
3-Jul-01 12:30
suss3-Jul-01 12:30 
GeneralRe: STL and UNICODE Pin
[James Pullicino]3-Jul-01 5:18
[James Pullicino]3-Jul-01 5:18 
Generalload image Pin
Kathrin2-Jul-01 16:08
Kathrin2-Jul-01 16:08 
GeneralRe: load image Pin
Christian Graus2-Jul-01 17:38
protectorChristian Graus2-Jul-01 17:38 
// Delete the current bitmap
if (m_bmpBitmap.DeleteObject())
// If there was a bitmap, detach it
m_bmpBitmap.Detach();

Why do you delete the bitmap and then detach it ?

In any case, if you want to write an imaging program, buy Windows Graphics Programming by Feng Yuan.

As to your question - why can't you check if the filename is valid ? I'd probably suggest that if there is a possibility that your program does not have a bitmap loaded, that this is a flaw to start with, or are you using this filename for saving ? If the former, you could instead check that the bitmap itself is valid. The easiest way to do that is to make it a pointer and check if it is NULL ( don't forget to set it to NULL to start with ).


I'm sorry if I've missed the point, it's great you posted some code in reference to your question, but there is so much code that I'm not sure what you're asking.

Do I read this correctly that your program is dialog based and has two dialogs open ?

Final comment - Hungarian notation can be a bit redundant - m_bmpBitmap is a tautology.



Christian

#include "std_disclaimer.h"

People who love sausage and respect the law should never watch either one being made.

The things that come to those who wait are usually the things left by those who got there first.

GeneralRe: load image Pin
Kathrin3-Jul-01 21:10
Kathrin3-Jul-01 21:10 
GeneralRe: load image Pin
Erik Thompson3-Jul-01 7:28
sitebuilderErik Thompson3-Jul-01 7:28 
GeneralRe: load image Pin
Kathrin3-Jul-01 22:00
Kathrin3-Jul-01 22:00 
GeneralRe: load image Pin
Erik Thompson4-Jul-01 7:24
sitebuilderErik Thompson4-Jul-01 7:24 
GeneralRe: load image Pin
Kathrin4-Jul-01 19:08
Kathrin4-Jul-01 19:08 
GeneralRe: load image Pin
Christian Graus4-Jul-01 19:15
protectorChristian Graus4-Jul-01 19:15 
Generalchange filename Pin
2-Jul-01 14:07
suss2-Jul-01 14:07 
GeneralRe: change filename Pin
Carlos Antollini2-Jul-01 14:56
Carlos Antollini2-Jul-01 14:56 
GeneralRe: change filename Pin
2-Jul-01 15:21
suss2-Jul-01 15:21 
GeneralRe: change filename Pin
3-Jul-01 5:22
suss3-Jul-01 5:22 
GeneralCOM IDL Pin
William Bartholomew2-Jul-01 12:42
William Bartholomew2-Jul-01 12:42 
GeneralRe: COM IDL Pin
Richard Caetano2-Jul-01 13:43
Richard Caetano2-Jul-01 13:43 
GeneralRe: COM IDL Pin
Richard Caetano2-Jul-01 13:47
Richard Caetano2-Jul-01 13:47 
GeneralAudio looping using waveform functions. Pin
2-Jul-01 10:47
suss2-Jul-01 10:47 
GeneralCStatusBarCtrl::SetIcon Pin
Rickard Andersson202-Jul-01 9:42
Rickard Andersson202-Jul-01 9:42 
GeneralRe: CStatusBarCtrl::SetIcon Pin
Michael Martin2-Jul-01 13:50
professionalMichael Martin2-Jul-01 13:50 
GeneralProblem importing mso97.dll Pin
Jamie Nordmeyer2-Jul-01 9:09
Jamie Nordmeyer2-Jul-01 9:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.