Click here to Skip to main content
15,901,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: newbie here:....what is the difference between WM_PAINT and WM_NCPAINT Pin
Andrew Peace9-Nov-04 0:37
Andrew Peace9-Nov-04 0:37 
GeneralRe: newbie here:....what is the difference between WM_PAINT and WM_NCPAINT Pin
Antony M Kancidrowski9-Nov-04 6:16
Antony M Kancidrowski9-Nov-04 6:16 
GeneralRe: newbie here:....what is the difference between WM_PAINT and WM_NCPAINT Pin
namaskaaram9-Nov-04 17:04
namaskaaram9-Nov-04 17:04 
GeneralRe: newbie here:....what is the difference between WM_PAINT and WM_NCPAINT Pin
Antony M Kancidrowski10-Nov-04 10:58
Antony M Kancidrowski10-Nov-04 10:58 
GeneralRe: newbie here:....what is the difference between WM_PAINT and WM_NCPAINT Pin
namaskaaram9-Nov-04 17:12
namaskaaram9-Nov-04 17:12 
GeneralRe: newbie here:....what is the difference between WM_PAINT and WM_NCPAINT Pin
Antony M Kancidrowski10-Nov-04 11:04
Antony M Kancidrowski10-Nov-04 11:04 
GeneralRe: newbie here:....what is the difference between WM_PAINT and WM_NCPAINT Pin
namaskaaram10-Nov-04 18:17
namaskaaram10-Nov-04 18:17 
GeneralRe: newbie here:....what is the difference between WM_PAINT and WM_NCPAINT Pin
Antony M Kancidrowski11-Nov-04 11:18
Antony M Kancidrowski11-Nov-04 11:18 
The easiest way to do this is to pass a pointer to the dialog into the CMyClass. We will call the dialog CMyDialog.

CMyClass header file
public:
  void SetDialog(CMyDialog* pDialog);
<p></p>
private:
  CMyDialog* m_pDialog;

CMyClass cpp file
void CMyClass::SetDialog(CMyDialog* pDialog)
{
  m_pDialog = pDialog;
}
<p></p>
void CMyClass::SomeUpdateFunction
{
  m_pDialog->Invalidate();
  m_pDialog->UpdateWindow();
or
  m_pDialog->SendMessage(WM_PAINT, NULL, NULL);
or
  m_pDialog->RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
}


Notice that I have given you 3 alternative ways to do the update in the update function.


I have made the assumption that Within the CMyDialog class you have defined the CMyClass as follows

CMyDialog header file
CMyClass m_MyClass;

CMyDialog cpp file
BOOL CMyDialog::OnInitDialog()
{
   :
  m_MyClass.SetDialog(this);
   :
  return TRUE;
}



Hope that this is clear

Ant.

I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return!
- David Walliams (Little Britain)

GeneralRe: newbie here:....what is the difference between WM_PAINT and WM_NCPAINT Pin
namaskaaram11-Nov-04 21:52
namaskaaram11-Nov-04 21:52 
GeneralChanging font on my CTreeCtrl &#8211; item Pin
anderslundsgard9-Nov-04 0:08
anderslundsgard9-Nov-04 0:08 
GeneralRe: Changing font on my CTreeCtrl &#8211; item Pin
RChin9-Nov-04 3:05
RChin9-Nov-04 3:05 
GeneralRe: Changing font on my CTreeCtrl &#8211; item Pin
anderslundsgard9-Nov-04 3:24
anderslundsgard9-Nov-04 3:24 
GeneralBitwise operators Pin
Anonymous8-Nov-04 23:34
Anonymous8-Nov-04 23:34 
GeneralRe: Bitwise operators Pin
Phil J Pearson8-Nov-04 23:53
Phil J Pearson8-Nov-04 23:53 
GeneralRe: Bitwise operators Pin
Anonymous9-Nov-04 0:14
Anonymous9-Nov-04 0:14 
GeneralMemory leak Pin
gunnar668-Nov-04 23:22
gunnar668-Nov-04 23:22 
GeneralRe: Memory leak Pin
David Crow9-Nov-04 2:31
David Crow9-Nov-04 2:31 
GeneralRe: Memory leak Pin
gunnar669-Nov-04 2:54
gunnar669-Nov-04 2:54 
GeneralRe: Memory leak Pin
David Crow9-Nov-04 3:02
David Crow9-Nov-04 3:02 
Generalsearching for tool that converts bitstream file to .MPEG or .AVI Pin
pradeep35958-Nov-04 23:12
pradeep35958-Nov-04 23:12 
GeneralUsing a MFC dll from ordinary win32 console application Pin
gixxi8-Nov-04 23:01
gixxi8-Nov-04 23:01 
GeneralSome Introduction About Encode and Decode Pin
Guoguor8-Nov-04 21:59
Guoguor8-Nov-04 21:59 
GeneralRe: Some Introduction About Encode and Decode Pin
Phil J Pearson8-Nov-04 23:55
Phil J Pearson8-Nov-04 23:55 
GeneralRe: Some Introduction About Encode and Decode Pin
David Crow9-Nov-04 3:10
David Crow9-Nov-04 3:10 
GeneralC++ and HTML Pin
bjcee8-Nov-04 21:26
bjcee8-Nov-04 21:26 

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.