This method returns a long value that represents the BlackIceDEVMODE handle. This handle is used by the rest of the methods to read and modify the settings of the printer.
The LoadBlackIceDEVMODE method allocates the memory space required for the DevMode structure ( for the printer settings). The function returns the current user settings from the registry.
NOTE: The memory must be freed using the ReleaseBlackIceDEVMODE method.
LoadBlackIceDEVMODE(PrinterName As String) As Long
Input value: PrinterName - Printer Name
Return value - handle to the BlackIceDEVMODE
If the return value is 0, the DevMode loading failed.
NOTE: For 32-bit applications , use pBlackIceDEVMODE as Integer, instead of Long.
Comment:
The printer driver OCX or ActiveX control API was designed when VB6 was the norm.
The OCX or ActiveX control API functions can be used from VB6, VB.NET, C#, etc. These languages have different integer sizes.
With 32 bit applications a 32 bit integer size should be used, with 64 bit applications a 64 bit integer size should be used for pointers to the BlackIceDEVMODE structures.
One should call ReleaseBlackIceDEVMODE for all DEVMODE handles whether it is returned by LoadBlackIceDEVMODE or CreateDefaultSettings
The table below show languages and their integer sizes.
|
VB6 |
VB.NET |
C# |
16 bit |
Integer |
Short |
short |
32 bit |
Long |
Integer |
int |
64 bit |
|
Long |
long |