Professional Documents
Culture Documents
Communication Driver QPrintFM
Communication Driver QPrintFM
x
How to implement the QPrintFM.dll in your project
First of all to use the QPrintFm.dll for your application it is required that your application knows where is
the QPrintFM.dll is stored. The best solution is to Copy the QPrintFM.dll to the folder of your application
binary file.
Borland C++:
Add the QPrintFM.lib to your project (required to call the available function)
To use the function in your source you should append the following line to your *.c file:
Now you can call the QPrintFM.dll function in your *.c file like this:
Visual Basic:
To use the function you should implement the following lines to your *.frm file:
Private Declare Function FreeLibrary Lib "kernel32.dll" (ByVal hLibModule As Long) As Long
Private Declare Function LoadLibrary Lib "kernel32.dll" Alias "LoadLibraryA" (ByVal
lpLibFileName As String) As Long
Now should implement the LoadLibary function in the form load event like this:
If you load the libary you shouldnt forget to give it free. In this case you should call the
FreeLibrary function on your form termination like this:
Now you can call the QPrintFM.dll in your *.frm file like this:
TransmitPrinterCommand(..., ..., ..., ...)
Transmit Command
Function:
char* TransmitPrinterCommand(int IPCom, char* Port, int BaudRateNr, char* Command);
Parameters:
int IPCom = the connection mode (0 = Serial COM connection , 1 = Ethernet connection)
char* Port = is the interface that you would reach
for COM-> (COM1,
COM2,
COM3,
COM4,
COM5,
COM6,
COM7,
COM8, ...)
for Ethernet-> (192.168.1.200,
192.168.1.201, ...)
[is the printer base IP address]
int BaudRateNr = is the transmission rate or the printer number (by Ethernet)
for COM-> (1200,
2400,
4800,
9600,
19200,
38400,
57600,
115200)
for Ethernet-> printer number if you use more then one printer into a network