0

About CView problem,thank:)
<<<<<<<<<Preview.H>>>>>>>
class Preview : public CView
{
public:
virtual void OnDraw(CDC* pDC);
virtual BOOL OnPreparePrinting(CPrintInfo *pInfo);
void OnPrint(CDC *pDC, CPrintInfo* pInfo);
};
<<<<<<Preview.CPP>>>>>>>>>
void Preview::OnDraw(CDC* /*pDC*/)
{
}
BOOL Preview::OnPreparePrinting(CPrintInfo* pInfo)
{
return DoPreparePrinting(pInfo);
}
void Preview::OnPrint(CDC *pDC, CPrintInfo* pInfo)
{
CString str=_T("rrr");
pDC->TextOut(0,30,str);
}

<<<<<<<<<<<Dialog.Cpp>>>>>>>>
Preview * p=new Preview();
p->GetDC()->TextOutW(1,2,_T("rxg"));
i think add char to p;
Debug no Error,but run Error
how to add char to TextOutW function in p

sorry,My English isn't good
thank:)

2
Contributors
1
Reply
2
Views
11 Years
Discussion Span
Last Post by Ancient Dragon
0

<<<<<<<<<<<Dialog.Cpp>>>>>>>>
Preview * p=new Preview();
p->GetDC()->TextOutW(1,2,_T("rxg"));
i think add char to p;
Debug no Error,but run Error
how to add char to TextOutW function in p

sorry,My English isn't good
thank:)

after calling new you have to call its Create() method. I don't recall all the parameters, but you can find them at www.microsoft.com

Preview * p=new Preview();
p->Create( <snip> );
...

Edited by Nick Evan: Fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.