View Issue Details

IDProjectCategoryView StatusLast Update
0002090Ham Radio DeluxeBugpublic2019-03-31 11:13
ReporterK7ZCZAssigned Todoug 
Status closedResolutionfixed 
PlatformIntel i7-5960XOSWindows 10 Professional x64OS Version1703
Product Version6.4.0.657 
Target VersionFixed in Version6.5.0.207 
Summary0002090: Printing labels doesn't work
DescriptionAn attempt to print labels results in an error and a blank page. This is not what most users will want.
Steps To Reproduce1) Open the Logbook; open your favorite database
2) Select a logbook entry
3) Right-click on the entry to get a context menu
4) On the context menu, select the "Print" tear off; in there, take the "Print..." tear off, and then use the "Labels" command
5) Keep the defaults in the print configuration box. (Of course, you'll probably want to select your printer, or maybe print to PDF)
6) Press the "Print" pushbutton

BUG#1) This mesage box is displayed:

HRD Logbook
Display Page Memory Error

7) Press OK

BUG#2) A blank page is printed.
TagsNo tags attached.
Testing Beta Successful


related to 0001747 closedARMAN QSO Label print always prints wrong date 



2018-06-14 08:40

manager   ~0005323

I don't believe this is a temporal out-of-memory condition. If the printer has a high dot pitch (or, I guess, big paper), the user will always run out of memory when trying to print. Here's the call stack to the error message:

>	HRDLogbook.exe!CLabelSheet::DrawPage(CDC * pDC=0x005fef50, CRect rectPage={...}, _devicemodeW * lpDevMode=0x1f595c40, bool bDrawOutlines=false, int iIndex=0, bool bPreview=false, bool bQSL2=false) Line 1211	C++
     HRDLogbook.exe!CLabelSheet::OnBnClickedPrint() Line 1036	C++
     HRDLogbook.exe!_AfxDispatchCmdMsg(CCmdTarget * pTarget=0x1f5964a0, unsigned int nID=3, int nCode=0, void (void) * pfn=0x01621848, void * pExtra=0x00000000, unsigned int nSig=58, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 77	C++
     HRDLogbook.exe!CCmdTarget::OnCmdMsg(unsigned int nID=3, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 373	C++
     HRDLogbook.exe!CDialog::OnCmdMsg(unsigned int nID=3, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 85	C++
     HRDLogbook.exe!CWnd::OnCommand(unsigned int wParam=3, long lParam=333896) Line 2784	C++
     HRDLogbook.exe!CDialogEx::OnCommand(unsigned int wParam=3, long lParam=333896) Line 290	C++
     HRDLogbook.exe!CWnd::OnWndMsg(unsigned int message=273, unsigned int wParam=3, long lParam=333896, long * pResult=0x005ff440) Line 2108	C++
     HRDLogbook.exe!CWnd::WindowProc(unsigned int message=273, unsigned int wParam=3, long lParam=333896) Line 2094	C++
     HRDLogbook.exe!AfxCallWndProc(CWnd * pWnd=0x1f5964a0, HWND__ * hWnd=0x000814fe, unsigned int nMsg=273, unsigned int wParam=3, long lParam=333896) Line 282	C++
     HRDLogbook.exe!AfxWndProc(HWND__ * hWnd=0x000814fe, unsigned int nMsg=273, unsigned int wParam=3, long lParam=333896) Line 435	C++
     user32.dll!__InternalCallWinProc@20()	Unknown
     user32.dll!UserCallWinProcCheckWow()	Unknown
     user32.dll!SendMessageWorker()	Unknown
     user32.dll!SendMessageW()	Unknown
     comctl32.dll!Button_NotifyParent(struct tagBUTN *,unsigned int)	Unknown
     comctl32.dll!Button_ReleaseCapture()	Unknown
     comctl32.dll!Button_WndProc()	Unknown
     user32.dll!__InternalCallWinProc@20()	Unknown
     user32.dll!UserCallWinProcCheckWow()	Unknown
     user32.dll!DispatchMessageWorker()	Unknown
     user32.dll!IsDialogMessageW()	Unknown
     HRDLogbook.exe!CWnd::IsDialogMessageW(tagMSG * lpMsg=0x045ce148) Line 193	C++
     HRDLogbook.exe!CWnd::PreTranslateInput(tagMSG * lpMsg=0x045ce148) Line 4590	C++
     HRDLogbook.exe!CDialog::PreTranslateMessage(tagMSG * pMsg=0x045ce148) Line 80	C++
     HRDLogbook.exe!CDialogEx::PreTranslateMessage(tagMSG * pMsg=0x045ce148) Line 275	C++
     HRDLogbook.exe!CWnd::WalkPreTranslateTree(HWND__ * hWndStop=0x00031112, tagMSG * pMsg=0x045ce148) Line 3363	C++
     HRDLogbook.exe!AfxInternalPreTranslateMessage(tagMSG * pMsg=0x045ce148) Line 233	C++
     HRDLogbook.exe!CWinThread::PreTranslateMessage(tagMSG * pMsg=0x045ce148) Line 777	C++
     HRDLogbook.exe!CHRDLogbookApp::PreTranslateMessage(tagMSG * pMsg=0x045ce148) Line 1431	C++
     HRDLogbook.exe!AfxPreTranslateMessage(tagMSG * pMsg=0x045ce148) Line 252	C++
     HRDLogbook.exe!AfxInternalPumpMessage() Line 178	C++
     HRDLogbook.exe!CWinThread::PumpMessage() Line 900	C++
     HRDLogbook.exe!CWinThread::Run() Line 629	C++
     HRDLogbook.exe!CWinApp::Run() Line 787	C++
     HRDLogbook.exe!AfxWinMain(HINSTANCE__ * hInstance=0x00c30000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x045c3458, int nCmdShow=10) Line 47	C++
     HRDLogbook.exe!wWinMain(HINSTANCE__ * hInstance=0x00c30000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x045c3458, int nCmdShow=10) Line 26	C++
     HRDLogbook.exe!__tmainCRTStartup() Line 251	C
     HRDLogbook.exe!wWinMainCRTStartup() Line 165	C
     kernel32.dll!@BaseThreadInitThunk@12()	Unknown
     ntdll.dll!__RtlUserThreadStart()	Unknown
     ntdll.dll!__RtlUserThreadStart@8()	Unknown

CreateCombpatibleBitmap() has failed because it can't allocate enough memory. The code preceeding this error message shows that the printing code is trying to allocate a bitmap for a page. Comments indicate that the largest dimension of the sheet is used for both dimensions of the bitmap. That is, if the printer is set for an 8.5 x 11 inch page, 11 inches is used for both sides. 11 inches times the dot-per-inch resolution of the printer gives the number of pixels the bitmap will contain. For me, 1200 dpi times 11 inches means that there's 13200^2 pixels in the image.

That's a huge nubmer. A 32-bit process is likely to run out of memory for that much storage, unless the printer is monochrome (that is, one bit per pixel).

At that call stack, I can see that lMaxPaper == 13200. lpDevMode shows that yResolution, PrintQuality are 1200. Even though dmColor is 2, it's still too much data to stick into a single bitmap in a 32-bit process.


2018-06-14 08:45

manager   ~0005324

My printer has 1200 dpi resolution. It's possible to repro this issue trivially with a printer at high resolution. I also have Adobe Acrobat Pro, which installs a printer driver that creates PDF files as output. That provides a pretty easy way to develop this error.

1) Load the logbook
2) Open your favorite database
3) Highlight a few records, maybe six or so
4) Right-click on the highlighted records
5) In the resulting context menu, use the "File" tear-off which has a "Print" tear-off, which has a "Labels" command
6) In the resulting "Labels" dialog, activate the "Print" tab
7) In the "Print" tab, select "Adobe PDF" (or, you could choose your printer here)
8) Click "Properties ..."
9) in the printer properties, select the "Adobe PDF Settings" tab" (Or, set your printer to 1200 dpi mode and go to step 11
10) Select "High Quality Print" in the "Default Settings" dropdown. That's a settings batch that has 1200 dpi as default
11) Click OK to close the settings dialog
12) Back in the Logbook "Labels" dialog, press "Print"
13) Click "OK" on the "Page setup" dimension

BUG#1) couldn't create the bitmap because it's too big, get an out of memroy error:

HRD Logbook
Display Page Memory Error


2019-03-30 05:43

administrator   ~0007801

As I test the 205 build, this is no longer happening.

(That said, there are remaining issues related to printing to a QSL card that we need to resolve. But that wasn't referenced here.)

Issue History

Date Modified Username Field Change
2017-07-02 15:50 K7ZCZ New Issue
2017-07-02 15:51 K7ZCZ Relationship added related to 0001747
2017-09-18 00:14 WA9PIE Project 3 - Current Dev List => 2 - Next Dev List (Holding Area)
2018-03-04 00:49 WA9PIE Status new => assigned
2018-03-04 00:49 WA9PIE Assigned To => ARMAN
2018-03-04 00:49 WA9PIE Project 2 - Next Dev List (Holding Area) => 3 - Current Dev List
2018-03-04 00:52 WA9PIE Testing => Not Started
2018-06-14 08:40 K7ZCZ Note Added: 0005323
2018-06-14 08:45 K7ZCZ Note Added: 0005324
2019-02-26 17:29 WA9PIE Assigned To ARMAN => doug
2019-03-30 05:43 WA9PIE Status assigned => closed
2019-03-30 05:43 WA9PIE Resolution open => fixed
2019-03-30 05:43 WA9PIE Fixed in Version =>
2019-03-30 05:43 WA9PIE Testing Not Started => Beta Successful
2019-03-30 05:43 WA9PIE Note Added: 0007801
2019-03-31 11:13 WA9PIE Fixed in Version =>
2019-03-31 11:13 WA9PIE Project 3 - Current Dev List => Ham Radio Deluxe