المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : print in splitted window



C++ Programming
04-08-2009, 01:14 PM
i have the following code to print the input and the output of 2 deifferent classes / fileds when i click the : print output or print input the programm comes to the function PrintOutput or PrintInput inside these 2 functions i have this code line to reset the cursor
position in the right filed which content to be printed and set the windows message to ID_FILE_PRINT which is in the normal case the element to be clicked in order to call OnFilePrint(). when i use OnFilePrint()indicators get an Assert debug failure because hDC is not intialized, i do not kn ow if this is the right way to solve this problem.

this is in the file sql_input.cpp

void CSQL_Input_View::OnPrintInput ()
{
m_wndSplitter.SetActivePane(0,0,0); // reset cursor position
PostMessage (WM_COMMAND, ID_FILE_PRINT);
//CEditView::OnFilePrint();
}
and this is in the file sql_output.cpp

void CSQL_Output_View::OnPrintOutput ()
{
m_wndSplitter.SetActivePane(1,0,0); // reset cursor position
PostMessage (WM_COMMAND, ID_FILE_PRINT);
//CEditView::OnFilePrint();
}

Any help would be appriciated.