We are using VPE 3.50. The VpeSetupPrinter method call is causing GDI leak. Is this a bug in VPE?
When the following code is executed in an application, the gdi objects count
in the window task manager will increase 4 every time. However, if the
EnableWindow(FALSE) is commented out, no gdi leak is reported.
- Code: Select all
// Disable the application window as suggested by FQA.
CWnd* pWnd = AfxGetApp()->GetMainWnd();
pWnd->EnableWindow(FALSE);
long hDoc = ::VpeOpenDoc(GetSafeHwnd(), "",
VPE_NO_STATUSSEG + VPE_NO_RULERS);
::VpeLicense(hDoc, "VPE-XXXXX-XXXX", "XXXX-XXXX");
::VpeSetPrintOptions(hDoc, PRINT_ALL + PRINT_NO_AUTO_PAGE_DIMS);
CString str = _T("c:\\temp\\print.prs");
::VpeSetupPrinter(hDoc, str, PRINTDLG_ALWAYS);
::VpeCloseDoc(hDoc);
pWnd->EnableWindow();
Thanks,
czhu