Jaime Wyant
April 20th, 1999, 09:45 AM
I have some classes that are as follows:
CTreeCtrl
|
|
MyTree1
|
|
MyTree2
In 'MyTree2', there are instances where the tree will be empty, and I want to display some text in the window instead. I tried grabbing a DC and doing a .TextOut(), but this does not work... Unless I use a CPaintDC. But, I read that I should only use a CPaintDC in response to a OnPaint() [ WM_PAINT msg ]...
Below are my code snippets:
// This one don't work
CClientDC dc(this);
dc.TextOut(0, 0, "No employee selected for this view");
// This does work...
CPaintDC* pDC = new CPaintDC(this);
pDC->TextOut(10,50, "No employee selected for this view");
delete pDC;
Can anyone give me a clue?
Thanks,
Jaime
CTreeCtrl
|
|
MyTree1
|
|
MyTree2
In 'MyTree2', there are instances where the tree will be empty, and I want to display some text in the window instead. I tried grabbing a DC and doing a .TextOut(), but this does not work... Unless I use a CPaintDC. But, I read that I should only use a CPaintDC in response to a OnPaint() [ WM_PAINT msg ]...
Below are my code snippets:
// This one don't work
CClientDC dc(this);
dc.TextOut(0, 0, "No employee selected for this view");
// This does work...
CPaintDC* pDC = new CPaintDC(this);
pDC->TextOut(10,50, "No employee selected for this view");
delete pDC;
Can anyone give me a clue?
Thanks,
Jaime