Archiv für ‘32/64bit Wrapper’

eDocPrintPro – 32bit / 64bit wrapper – .NET based to use 32bit applications with our 64bit printer driver on a 64bit operating system

2009-12-03 Von: Wolfgang May Kategorie(n): .NET, 32/64bit Wrapper, 64bit, Software-Entwicklung, eDocPrintPro Keine Kommentare →

The eDocPrintPro SDK is based on the eDocPort COM object. It is a 32-bit component on 32-bit OS and a 64 bit component on 64-bit OS.

The SDK documentation is similar for 32/64 bits, and most samples are similar: .NET samples works on both platforms, C++ samples must be compiled for the correct target platform and work. The Visual Basic samples are unusable on 64-bit os, because the vb framework does not recognize 64-bit com objects.

The wrapper was a bridge between 32-bits appplications running on 64-bit platform to allow them using the eDocPrintPro SDK. Because it uses remote objects, it ban be used to control a remote eDocPrintPro printer too.

The idea behind is to run an executable – the server – which connects the local eDocPrintPro COM interface, able to call all the SDK functions and to receive events. This server has a TCP communication interface for a maximum configurable number of clients, on the same workstation or on different workstations. The server maintains a list of connected clients with a hand-shake protocol. This means, each client sends “I’m life” messages to the server, so the server will disconnect the dead clients after a configured time-out. The server itself can be configured to run forever or to stop after the last client is disconnected and an additional time-out is spent.

Each client expose a dual interface to the host application: a .NET class collection and a COM objects collection – both with strong similarities with the regular SDK. So the application can perform all SDK functions using this wrapper.

What are the benefits of the wrapper?

  • The TCP communication breaks the barriers of the platforms and local workstation. A 32 bit applicaiton can exchange information with a 64-bit one, on the same computer or on different computers.
  • eDocPrintPro can be handled from a remote location: reading / writing settings or receiving events.
  • A multi client application can connect to different workstation and monitor what’s printing.
  • The client interface is more friendly for a developer, specially for a .NET developer.

What are the drawbacks ?

  • The application using the wrapper is more complicate to handle: there is a basic TCP port for SDK calls and subsequent ports for events, one for each connected client, as written in the documentation. The configuration must keep track of the existing port conflicts. The application cannot check it, if the communication port fails, the communication will terminate.
  • Firewalls and anti virus software must be configured to allow access to the needed ports for the server and clients. Not quite easy in a complex network.
  • The calls are a little slower than the direct SDK accesses, but nothing wrong here, because not big data is handled.

The server (eDocSdkWrapper.exe) is PAM protected. It will work full 30 days. After the expiration, it will display a message box to each client connection.

>>> Download Setup eDocPrintPro SDK wrapper – 32 / 64bit .NET based
>>> Documentation eDocPrintPro SDK wrapper – 32 / 64bit .NET based

eDocPrintPro 64bit Version – 32bit Anwendungen

2009-03-30 Von: Wolfgang May Kategorie(n): .NET, 32/64bit Wrapper, 64bit, Software-Entwicklung, eDocPrintPro Keine Kommentare →

Um auf einem 64bit Microsoft Windows Betriebssystem – z.b. MS-Vista64 , Windows 2003-64 bzw. 2008 Server den  eDocPrintPro Druckertreiber zu installieren ist die 64bit Version des Treibers erforderlich. Will man nun diesen Treiber  über die SDK / API aus eigenen Anwendungen heraus ansteuern so muß man beachten dass dies nur aus 64bit Anwendungen – 64bit COM Schnittstelle – heraus möglich ist. Es ist also nicht einfach möglich den 64bit Treiber aus einer 32bit Anwendung heraus anzusprechen. .NET Anwendungen lassen sich relativ einfach von 32bit auf 64bit umstellen – bei anderen Entwicklungsumgebungen/Programmiersprachen ist eine solche Umstellung meist relative aufwändig bzw. auch eventuell nicht möglich.

Mögliche  Lösung:

Eine .NET Remoting Server Anwendung (EXE) der als x64 Prozess  läuft, wobei 32bit Anwendungen sich über .NET Remoting auf diesen verbinden können. Zur Kommunikation wird ein TCP Kanal oder aber auch HTTP bzw. IPC benutzt. Ein solcher .NET Remoting Server kann von der lokalen Arbeitsstation aber auch von externen Workstations aus “kontrolliert” und genutzt werden.

Geplante Implementierung für die eDocPrintPro API :

Implementierung als “64bit .NET Executable Wrapper” Anwendung  welche die eDocPrintPro SDK Funktionen den  Remote Clients zur Verfügung stellt, sowie eine 32bit .NET DLL die aus jeder beliebigen 32bit Anwendung heraus verwendet werden kann. Diese DLL stellt sowohl eine .NET als auch eine COM Schnittstelle zur Verfügung. Die DLL startet den Wrapper, führt die Interprozess-Kommunikation durch und stoppt diesen wenn erforderlich wieder. Die  Interprozess Kommunikation stellt damit die Brücke zwischen der 32bit Anwendung – über die 32bit DLL – und der 64bit Wrapper EXE her.  Die Warpper Anwendung kann nun direkt mit der eDocPrintPro API zusammenarbeiten – da  beide auf 64bit basieren.