rabit
asked on
Printing with Win32 api
prn_fh = CreateFile("Trouble.prn", GENERIC_WRITE, FILE_SHARE_WRITE, NULL ,
OPEN_ALWAYS , FILE_ATTRIBUTE_SYSTEM, NULL);
CloseHandle(prn_fh);
// Fill in the structure with info about this "document"
DocInfo.pDocName = "Trouble.prn";
DocInfo.pOutputFile = NULL;
DocInfo.pDatatype = "RAW";
// Inform the spooler the document is beginning
if( (job = StartDocPrinter( hpr, 1, (unsigned char*)&DocInfo )) == 0 )
{
stat = GetLastError ();
// stat == 32 sharing violation. What am I doing wrong???
Ps OpenPrinter ( in prevous section) doesn't return an error!
OPEN_ALWAYS , FILE_ATTRIBUTE_SYSTEM, NULL);
CloseHandle(prn_fh);
// Fill in the structure with info about this "document"
DocInfo.pDocName = "Trouble.prn";
DocInfo.pOutputFile = NULL;
DocInfo.pDatatype = "RAW";
// Inform the spooler the document is beginning
if( (job = StartDocPrinter( hpr, 1, (unsigned char*)&DocInfo )) == 0 )
{
stat = GetLastError ();
// stat == 32 sharing violation. What am I doing wrong???
Ps OpenPrinter ( in prevous section) doesn't return an error!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!!!
ASKER
a file or writing to the printer. Somehow, I've got to get a list of( database) errors to a network printer! P.S. NT 4.0 server
MSVC 4?