|
From: Noorez K. <lor...@ho...> - 2006-06-27 05:04:07
|
When I try to debugg my print function...I receive the "An access violation=
(Segmentation Fault) was raised in your prorgram" error at the marked point=
where the function calls the PrintDlg() function. Can someone tell me if i=
've missed something initalizing the structure?bool print(HWND hwnd){ PR=
INTDLG pd; ZeroMemory(&pd, sizeof(PRINTDLG)); pd.lStructSize =3D sizeof(P=
RINTDLG); pd.hwndOwner =3D hwnd; pd.hDevMode =3D NULL; // Don't =
forget to free or store hDevMode pd.hDevNames =3D NULL; // Don't for=
get to free or store hDevNames pd.Flags =3D PD_USEDEVMODECOPIESANDCO=
LLATE | PD_RETURNDC; pd.nCopies =3D 1; pd.nFromPage =3D 0xFFFF; =
pd.nToPage =3D 0xFFFF; pd.nMinPage =3D 1; pd.nMaxPage =3D 0xF=
FFF; // try to retrieve the printer DC if( !PrintDlg( &pd ) ) // err=
or occurs here { MessageBox( NULL, "PrintDlg( &pd ) failed!", "Fa=
tal Error", MB_OK | MB_ICONERROR ); return -1; ...
_________________________________________________________________
Try Live.com - your fast, personalized homepage with all the things you car=
e about in one place.
http://www.live.com/getstarted=
|