Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

LPT-Schnittstelle ansprechen mit MS VC++ 6.0

Empfohlene Antworten

Veröffentlicht

Hi,

ich möchte meine LPT-Schneittstelle ansprechen,

jetzt meine Frage ist das genauso wie mit der Com-Schnittstelle mit CreateFile() oder

ist das eigentlich das selbe ??

thx für jede Hilfe !

Entweder so (CFile ist die einfachste Methode) oder über einen PrinterDeviceContext. Dort kann man den Port und alles weitere direkt angeben und so nicht nur Text, sondern auch Grafik anstatt auf normale DCs einfach zum Drucker durchschicken.


    HDC hdcPrint;               // printer DC handle 

    char szDevString[120];      // array for WIN.INI data 

    char *szPrinter, *szDriver; // printer and driver names 

    char *szPort;               // port name 


    // Retrieve the printer, printer driver, and 

    // output-port names from WIN.INI. 

    GetProfileString("windows", "device", ",,,", 

        szDevString, 120); 


    // Parse the string of names, setting ptrs as required 

    // If the string contains the required names, use them to 

    // create a device context. 

    if ((szPrinter = strtok(szDevString, 

               (const char *) ",")) 

            && (szDriver = strtok ((char *) NULL, 

               (const char *) ", ")) 

            && (szPort = strtok ((char *) NULL, 

               (const char *) ", "))) 

    {

        hdcPrint = CreateDC(szDriver, szPrinter, 

            szPort, NULL); 

    }

    // Print a test page that contains the string 

    // "PRINTER TEST" in the upper left corner. 

     Escape(hdcPrint, STARTDOC, 8, "Test-Doc", NULL); 

    TextOut(hdcPrint, 50, 50, "PRINTER TEST", 12); 

    Escape(hdcPrint, NEWFRAME, 0, NULL, NULL); 

    Escape(hdcPrint, ENDDOC, 0, NULL, NULL); 

     // Delete the printer DC. 

     DeleteDC(hdcPrint); 

Es gibt auch noch die Möglichkeit direkt über Bios-Funktionen das ganze in Assembler aufzurufen, allerdings wird sowas wie bdos() oder int86() glaub unter NT und 2K nicht mehr unterstützt (evtl noch mit Tricks bei Inline-Assembler, aber selbst da wird dann fast alles vom Kernal abgefangen).

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.