I'm trying to convert a VB example (see http://support.microsoft.com/default.aspx?scid=kb;en-us;154078) of sending data directly to the print spooler and I am having trouble with the StartDocPrinter function because of a special parameter. The function prototype looks like:
DWORD StartDocPrinter(
HANDLE hPrinter, // handle to printer object
DWORD Level, // information level
LPBYTE pDocInfo // information buffer
);
and pDocInfo as:
typedef struct _DOC_INFO_1 {
LPTSTR pDocName;
LPTSTR pOutputFile;
LPTSTR pDatatype;
} DOC_INFO_1;
I configured the Call Library Function as following:
stdcall(WINAPI) calling convention,
DWORD return parameter as U32,
HANDLE hPrinter as U32 pass by value,
DWO
RD Level as U32 pass by value,
LPBYTE pDocInfo as ???.
Right now for pDocInfo, I am using a 2D array of U8 with nothing in it which allows the function to at least be called without an exception error but does not return a passing indication of proper use (always returns a 0).
This would make sending HPGL plot files to a LaserJet a breeze. Thanks.