morefalt
asked on
CPrintSetupDialog
Hi!
I have a problem with CPageSetupDialog. I have two classes CMyclass1 (in the first DLL) and CMyclass2 (in the second DLL) that use my CMyPrint-class (in a third DLL). From CMyclass1 CPageSetupDialog work great, but form CMyclass2 CPrintSetupDialog hangs when I call DoModa(). I have traced it to the API call to PrintSetupDlg().
Do anyone have a clue how to findout why??
Thank's in advance.
Bertil Morefeldt
My code look like this:
void CMyclass1::PrintAkut(long lID)
{
CMyPrint clPrint;
CString szRapport = ".\\Rapporter\\Akut.rpt";
CString szSQL;
szSQL.Format("{Akut.Uh_id} =%ld",lID) ;
clPrint.Print(GetRptEngine (),GRANSKA ,1,szRappo rt,szSQL);
}
void CMyclass2::PrintReciept(lo ng lID)
{
CMyPrint clPrint;
CString szRapport = ".\\Rapporter\\NyckelRecie pt.rpt";
CString szSQL;
szSQL.Format("{NyckelUtl.I D}=%ld",nI D);
clPrint.Print(GetRptEngine (),SKRIVUT ,1,szRappo rt,szSQL);
}
void CMyPrint::Print(....)
{
.....
....
CPageSetupDialog dlg;
dlg.m_psd.hDevMode = NULL;
dlg.m_psd.hDevNames = NULL;
if( dlg.DoModal() == IDOK )
{
if(!pJob->SelectPrinter(dl g.GetDrive rName(),
dlg.GetDeviceName(),
dlg.GetPortName(),0) )
{
AfxMessageBox(pEngine->Get ErrorText( ));
GlobalFree(dlg.m_psd.hDevM ode);
GlobalFree(dlg.m_psd.hDevN ames);
return FALSE;
}
}
GlobalFree(dlg.m_psd.hDevM ode);
GlobalFree(dlg.m_psd.hDevN ames);
....
....
}
I an using Visual C++ 6.0 an WinNT 4.0 sp 4.
I have a problem with CPageSetupDialog. I have two classes CMyclass1 (in the first DLL) and CMyclass2 (in the second DLL) that use my CMyPrint-class (in a third DLL). From CMyclass1 CPageSetupDialog work great, but form CMyclass2 CPrintSetupDialog hangs when I call DoModa(). I have traced it to the API call to PrintSetupDlg().
Do anyone have a clue how to findout why??
Thank's in advance.
Bertil Morefeldt
My code look like this:
void CMyclass1::PrintAkut(long lID)
{
CMyPrint clPrint;
CString szRapport = ".\\Rapporter\\Akut.rpt";
CString szSQL;
szSQL.Format("{Akut.Uh_id}
clPrint.Print(GetRptEngine
}
void CMyclass2::PrintReciept(lo
{
CMyPrint clPrint;
CString szRapport = ".\\Rapporter\\NyckelRecie
CString szSQL;
szSQL.Format("{NyckelUtl.I
clPrint.Print(GetRptEngine
}
void CMyPrint::Print(....)
{
.....
....
CPageSetupDialog dlg;
dlg.m_psd.hDevMode = NULL;
dlg.m_psd.hDevNames = NULL;
if( dlg.DoModal() == IDOK )
{
if(!pJob->SelectPrinter(dl
dlg.GetDeviceName(),
dlg.GetPortName(),0) )
{
AfxMessageBox(pEngine->Get
GlobalFree(dlg.m_psd.hDevM
GlobalFree(dlg.m_psd.hDevN
return FALSE;
}
}
GlobalFree(dlg.m_psd.hDevM
GlobalFree(dlg.m_psd.hDevN
....
....
}
I an using Visual C++ 6.0 an WinNT 4.0 sp 4.
Hi
cannot figure out why by the code snippet so
If it is OK with U can U send me the files my email id is inpras@hotmail.com
Just a interest OK
Regards
cannot figure out why by the code snippet so
If it is OK with U can U send me the files my email id is inpras@hotmail.com
Just a interest OK
Regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER