Hier ein kleines Puzzle, folgt man der Dokumentation dient dazu
AddPort
The AddPort function adds the name of a port to the list of supported
ports. The AddPort function is exported by the port monitor.
Also gut also muß ja wohl der Port Monitor dieses Ding implementieren.
dafür benötig man den Docs zufole InitializePrintMonitor2, dazu steht in
der doc:
The InitializePrintMonitor2 function must be exported by language
monitors and by port monitor server DLLs.
also gut, die Struktur soll so aussehen:
http://msdn2.microsoft.com/en-us/library/aa506742.aspx
weiter unten liest man dann aber:
pfnAddPort
(Obsolete. Should be NULL.) Pointer to the print monitor's AddPort
function.
pfnAddPortEx
(Obsolete. Should be NULL.) Pointer to the print monitor's
AddPortEx function. (Port monitors only.)
pfnConfigurePort
(Obsolete. Should be NULL.) Pointer to the print monitor's
ConfigurePort function.
pfnDeletePort
(Obsolete. Should be NULL.) Pointer to the print monitor's
DeletePort function.
Also it exportierte Funktion soll auf NULL gesetzt sein und irgendetwas
machen? Was ja wohl irgendwie nicht funktionieren kann.
Also hat jemand eine "hasenreine" Lösung wie man AddPort auf Windows
Vista benutzen kann?
In dem sinnigen Beispiel localmon findet man:
MONITOR2 Monitor2 = {
sizeof(MONITOR2),
LcmEnumPorts,
LcmOpenPort,
NULL, // OpenPortEx is not supported
LcmStartDocPort,
LcmWritePort,
LcmReadPort,
LcmEndDocPort,
LcmClosePort,
NULL, // AddPort is not supported
LcmAddPortEx,
NULL, // ConfigurePort is not supported
NULL, // DeletePort is not supported
LcmGetPrinterDataFromPort,
LcmSetPortTimeOuts,
LcmXcvOpenPort,
LcmXcvDataPort,
LcmXcvClosePort,
LcmShutdown
};
Also zumindest eine Implementierung für das Hinzufügen eines Ports,
allerdings wiederspricht das komplett den Docs.
Offentsichtlich arbeitet das aber wohl zufriedenstellend. Also muß ich
das nun auch implementieren oder gibt es da eine wirklich "saubere" Lösung.
Ich denke keiner wird das ohne Mühe verstehen können, deswegen im
Vorraus eine großes Danke.....
Bis dann
Friedrich