+ memset(lpBits, '\0', (nBytePerLine * nHeight));
+ hBitmap = (HBITMAP)GetHBITMAP();
+
+ //
+ // May already be selected into a PS
+ //
+ if ((pDC = GetSelectedInto()) != NULL)
+ {
+ hPSMem = pDC->GetHPS();
+ }
+ else
+ {
+ hDCMem = ::DevOpenDC( vHabmain
+ ,OD_MEMORY
+ ,"*"
+ ,5L
+ ,(PDEVOPENDATA)&vDop
+ ,NULLHANDLE
+ );
+ hPSMem = ::GpiCreatePS( vHabmain
+ ,hDCMem
+ ,&vSizlPage
+ ,PU_PELS | GPIA_ASSOC
+ );
+ }
+ if ((hOldBitmap = ::GpiSetBitmap(hPSMem, hBitmap)) == HBM_ERROR)
+ {
+ ERRORID vError;
+ wxString sError;
+
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }