Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Treue Seele
Wohnort: fragt einfach per pm nix da ;)
Beruf: Ausbildung (Technischer Assistent für Software Technologie)
Zitat
PS : Es ist etwas eigenartig. Auf allen PC die ich getestet habe (auch die die kein Borland installiert haben) Läuft es so einwandfrei. Aber bei manchen Freunden dennen ich es gab traten fehler auf. Wen euch also ne Datei Fehlen sollte schreibts hier rein ich up´s dan.
Treue Seele
Wohnort: fragt einfach per pm nix da ;)
Beruf: Ausbildung (Technischer Assistent für Software Technologie)
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
Sample Code The following PrintStuff() function illustrates the printing process: /*==============================================*/ /* Sample code : Typical printing process */ /* =============================================*/ void PrintStuff( HWND hWndParent ) { HDC hDC; DOCINFO di; // Need a printer DC to print to. hDC = GetPrinterDC(); // Did you get a good DC? if( !hdc) { MessageBox(NULL, "Error creating DC", "Error", MB_APPLMODAL | MB_OK ); return; } // You always have to use an AbortProc(). if( SetAbortProc( hDC, AbortProc ) == SP_ERROR ) { MessageBox( NULL, "Error setting up AbortProc", "Error", MB_APPLMODAL | MB_OK); return; } // Init the DOCINFO and start the document. InitDocStruct( &di, "MyDoc"); StartDoc( hDC, &di ); // Print one page. StartPage( hDC ); DrawStuff( hDC ); EndPage( hDC ); // Indicate end of document. EndDoc( hDC ); // Clean up DeleteDC( hDC ); } /*===============================*/ /* Obtain printer device context */ /* ==============================*/ HDC GetPrinterDC(void) { PRINTDLG pdlg; // Initialize the PRINTDLG structure. memset( &pdlg, 0, sizeof( PRINTDLG ) ); pdlg.lStructSize = sizeof( PRINTDLG ); // Set the flag to return printer DC. pdlg.Flags = PD_RETURNDEFAULT | PD_RETURNDC; // Invoke the printer dialog box. PrintDlg( &pdlg ); // hDC member of the PRINTDLG structure contains // the printer DC. return pdlg.hDC; } /*===============================*/ /* The Abort Procudure */ /* ==============================*/ BOOL CALLBACK AbortProc( HDC hDC, int Error ) { MSG msg; while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } return TRUE; } /*===============================*/ /* Initialize DOCINFO structure */ /* ==============================*/ void InitDocStruct( DOCINFO* di, char* docname) { // Always zero it before using it. memset( di, 0, sizeof( DOCINFO ) ); // Fill in the required members. di->cbSize = sizeof( DOCINFO ); di->lpszDocName = docname; } /*===============================*/ /* Drawing on the DC */ /* ==============================*/ void DrawStuff( HDC hdc) { // This is the function that does draws on a given DC. // You are printing text here. TextOut(hdc, 0,0, "Test Printing", lstrlen( "Test Printing" ) ); } |
Werbeanzeige