PRB: StartDoc() Fails with Non-Zeroed DOCINFOID: Q135119
|
A call to StartDoc() fails, and no other reason for failure can be found.
The DOCINFO structure passed to StartDoc() is not initialized to zeros before use.
Perform the following three steps:
DOCINFO di;
// Get the DC, SetAbortProc(), and so on.
memset( &di, 0, sizeof( DOCINFO ) );
di.cbSize = sizeof( DOCINFO );
di.lpszDocName = "MyDoc";
if( StartDoc( hDC, &di ) <= 0 )
HandleFailure();
This behavior is by design.
As a general rule, any structure that has a member that indicates the size of the structure should be initialized to all zeros before being used by following the previous steps.
Additional query words: 3.10 4.00 fail error print DC
Keywords : kbcode kbprint kbNTOS350 kbNTOS351 kbNTOS400 kbSDKWin32 kbWinOS95 kbDSupport
Version : winnt:3.5,3.51,4.0
Platform : winnt
Issue type : kbprb
Last Reviewed: July 6, 1999