Click here to Skip to main content
16,006,348 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to make a Picture Transparent Using Memory DC only Pin
clemence28-Dec-01 18:02
clemence28-Dec-01 18:02 
AnswerRe: How to make a Picture Transparent Using Memory DC only Pin
Christian Graus29-Dec-01 0:04
protectorChristian Graus29-Dec-01 0:04 
GeneralTransparency Pin
clemence28-Dec-01 18:00
clemence28-Dec-01 18:00 
GeneralRe: Transparency Pin
Christian Graus29-Dec-01 0:02
protectorChristian Graus29-Dec-01 0:02 
GeneralRe: Transparency Pin
clemence29-Dec-01 17:44
clemence29-Dec-01 17:44 
GeneralRe: Transparency Pin
Christian Graus29-Dec-01 23:05
protectorChristian Graus29-Dec-01 23:05 
GeneralUsing auto_ptr :: C++ Pin
valikac28-Dec-01 16:06
valikac28-Dec-01 16:06 
GeneralRe: Using auto_ptr :: C++ Pin
James R. Twine28-Dec-01 16:52
James R. Twine28-Dec-01 16:52 
>Under what situation should one use auto_ptr instead of plain pointer?
> [...] I like auto_ptr because I trust that if something goes wrong at
> run-time, auto_ptr will help eliminate possible memory leaks.

   You generally use auto_ptr objects when using exception handling, so that if/when an exception is thrown, it will free it's contained pointer (the auto_ptr gets destructed as the stack is unwinding).

   A little known/respected fact about auto_ptr implementations: they normally call "delete" on the contained pointer, when they are destructed.  But what if the contained pointer should have been deleted with "delete[]"Eek! | :eek: ?  Depending on if your RTL/compiler treats "delete" and "delete[]" differently, you may or may not have a problem.

> P.S. auto_ptr declaration cannot be in a switch:

   Perhaps your syntax is incorrect.  This ia a bad example, but compiles for me (barring warnings):
	<br />
    switch( DWORD dwValue = 1 )<br />
    {<br />
        case	1:<br />
        {<br />
            std::auto_ptr< char >    cpChar( new char );<br />
        }<br />
    }<br />

   Peace!


-=- James.
GeneralRe: Using auto_ptr :: C++ Pin
valikac28-Dec-01 18:09
valikac28-Dec-01 18:09 
Questionwhen OnDraw will be EXECUTED? Pin
AnonymousBabe@usa.net28-Dec-01 14:29
AnonymousBabe@usa.net28-Dec-01 14:29 
GeneralDouble buffering and GDI+ Pin
Anders Molin28-Dec-01 11:52
professionalAnders Molin28-Dec-01 11:52 
GeneralRe: Double buffering and GDI+ Pin
Christian Graus28-Dec-01 15:04
protectorChristian Graus28-Dec-01 15:04 
GeneralRe: Double buffering and GDI+ Pin
Anders Molin29-Dec-01 3:57
professionalAnders Molin29-Dec-01 3:57 
Generalplease help Pin
hhh28-Dec-01 9:54
hhh28-Dec-01 9:54 
GeneralRe: please help Pin
Christian Graus28-Dec-01 10:09
protectorChristian Graus28-Dec-01 10:09 
GeneralRe: please help Pin
Christian Graus28-Dec-01 10:56
protectorChristian Graus28-Dec-01 10:56 
GeneralRe: please help Pin
Christian Graus28-Dec-01 11:23
protectorChristian Graus28-Dec-01 11:23 
GeneralRe: please help Pin
Ravi Bhavnani28-Dec-01 11:33
professionalRavi Bhavnani28-Dec-01 11:33 
GeneralRe: please help Pin
hhh28-Dec-01 11:52
hhh28-Dec-01 11:52 
GeneralRe: please help Pin
Ravi Bhavnani28-Dec-01 12:03
professionalRavi Bhavnani28-Dec-01 12:03 
Generalsorry, please check again... Pin
hhh28-Dec-01 12:08
hhh28-Dec-01 12:08 
GeneralRe: sorry, please check again... Pin
Christian Graus28-Dec-01 13:12
protectorChristian Graus28-Dec-01 13:12 
GeneralRe: sorry, please check again... Pin
Christian Graus28-Dec-01 13:19
protectorChristian Graus28-Dec-01 13:19 
GeneralRe: please help Pin
Tim Smith28-Dec-01 12:28
Tim Smith28-Dec-01 12:28 
GeneralRe: please help Pin
Tim Smith28-Dec-01 13:03
Tim Smith28-Dec-01 13:03 

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.