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:)

<<<<<<<<<<<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> );
...
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.