Click here to Skip to main content
16,005,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Overlap A Bitmap using DeviceContext Pin
002comp21-Oct-10 18:46
002comp21-Oct-10 18:46 
GeneralRe: Overlap A Bitmap using DeviceContext Pin
GAJERA21-Oct-10 21:33
GAJERA21-Oct-10 21:33 
GeneralRe: Overlap A Bitmap using DeviceContext Pin
002comp22-Oct-10 1:22
002comp22-Oct-10 1:22 
GeneralRe: Overlap A Bitmap using DeviceContext Pin
GAJERA22-Oct-10 4:26
GAJERA22-Oct-10 4:26 
QuestionAbout the CWinThread object creation / deletion Pin
federico.strati20-Oct-10 22:38
federico.strati20-Oct-10 22:38 
AnswerRe: About the CWinThread object creation / deletion Pin
Sauro Viti20-Oct-10 22:44
professionalSauro Viti20-Oct-10 22:44 
GeneralRe: About the CWinThread object creation / deletion Pin
federico.strati20-Oct-10 22:52
federico.strati20-Oct-10 22:52 
GeneralRe: About the CWinThread object creation / deletion Pin
Sauro Viti20-Oct-10 23:07
professionalSauro Viti20-Oct-10 23:07 
When the thread ends, the CWinThread could be automatically deleted (depending on its m_bAutoDelete member), but the object of CConsumer class that you have dinamically allocated, should be deleted; you can explicitly test for the thread termination and delete the object, or make it auto-delete.


  1. explicitly delete the object:
    C++
    CConsumer pConsumer = new CConsumer;
    ...
    // Somewhere in your code, periodically do this:
    if (!pConsumer->IsRunning())
       delete pConsumer;
  2. add auto-delete feature to CConsumer:
    C++
    class CConsumer
    {
       ...
    
    protected:
       static UINT ThreadFunc(LPVOID pVoid)
       {
          CConsumer* pConsumer = (CConsumer*)pVoid;
          UINT retVal = pConsumer->LocalThreadFunc();
          if (pConsumer->m_bAutoDelete)
             delete pConsumer;
          return retVal;
       }
    
       BOOL m_bAutoDelete;
    
       ...
    };

GeneralRe: About the CWinThread object creation / deletion Pin
federico.strati20-Oct-10 23:32
federico.strati20-Oct-10 23:32 
GeneralRe: About the CWinThread object creation / deletion Pin
Sauro Viti21-Oct-10 0:12
professionalSauro Viti21-Oct-10 0:12 
QuestionProject Integration Problem Pin
AmbiguousName20-Oct-10 22:32
AmbiguousName20-Oct-10 22:32 
AnswerRe: Project Integration Problem Pin
Cedric Moonen20-Oct-10 23:16
Cedric Moonen20-Oct-10 23:16 
QuestionHow can I give write access to a file to all users? [modified] Pin
sashoalm20-Oct-10 21:54
sashoalm20-Oct-10 21:54 
AnswerRe: How can I give write access to a file to all users? Pin
«_Superman_»20-Oct-10 22:59
professional«_Superman_»20-Oct-10 22:59 
QuestionC++ CStatusBar, Tool Tips and Dynamic PaneText Pin
ggoutam720-Oct-10 18:41
ggoutam720-Oct-10 18:41 
AnswerRe: C++ CStatusBar, Tool Tips and Dynamic PaneText Pin
«_Superman_»20-Oct-10 19:09
professional«_Superman_»20-Oct-10 19:09 
QuestionHow to use my defined resource ID in a DLL? [modified] Pin
questionmm20-Oct-10 13:11
questionmm20-Oct-10 13:11 
QuestionRead-Only ComboBox Pin
Fareed Rizkalla20-Oct-10 12:24
Fareed Rizkalla20-Oct-10 12:24 
AnswerRe: Read-Only ComboBox PinPopular
Peter_in_278020-Oct-10 13:46
professionalPeter_in_278020-Oct-10 13:46 
AnswerRe: Read-Only ComboBox Pin
Sauro Viti20-Oct-10 21:18
professionalSauro Viti20-Oct-10 21:18 
QuestionHow can I know if scrollbar appears ? Pin
mesajflaviu20-Oct-10 1:42
mesajflaviu20-Oct-10 1:42 
AnswerRe: How can I know if scrollbar appears ? Pin
Chris Meech20-Oct-10 3:23
Chris Meech20-Oct-10 3:23 
GeneralRe: How can I know if scrollbar appears ? Pin
mesajflaviu20-Oct-10 20:20
mesajflaviu20-Oct-10 20:20 
GeneralRe: How can I know if scrollbar appears ? Pin
Richard MacCutchan20-Oct-10 22:03
mveRichard MacCutchan20-Oct-10 22:03 
GeneralRe: How can I know if scrollbar appears ? Pin
mesajflaviu21-Oct-10 2:05
mesajflaviu21-Oct-10 2:05 

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.