I have another question about the structure. Right now I have some code that looks like this, which uses a similar structure as the example that you've pulled up:
Code:
PDFPRNINSTAPI BOOL PDFPRNINSTCALL PdfPrnInstDriverExistsW(WCHAR* pServerName,
WCHAR* pDriverName)
{
// variable declarations
//PDRIVER_INFO_6W pinfo = NULL;
LPBYTE pinfo = NULL;
DWORD pcbNeeded; // just to hold info on amount of bytes copied to
// driverInfo buffer
DWORD numDriversExist; // Number of drivers exist
BOOL ok;
// enumerates installed drivers
EnumPrinterDriversW(NULL,
NULL,
6, /* level uses the latest one */
NULL,
0,
&pcbNeeded,
&numDriversExist
);
if(pcbNeeded > 0)
{
try
{
pinfo = (LPBYTE) malloc(pcbNeeded);
}
catch (char* e)
{
pinfo = NULL;
printf("Exception raised: %s\n", e);
}
// now find the printer with the driver name
ok = EnumPrinterDriversW(NULL,
NULL,
6,
pinfo,
pcbNeeded,
&pcbNeeded,
&numDriversExist);
DRIVER_INFO_6W *foundInfo = (DRIVER_INFO_6W*) pinfo;
for (DWORD i=0; i < numDriversExist; i++)
{
// Print out information on the printers
cout << "Iteration " << i << endl;
cout << "pName = " << foundInfo[i].pName << endl;
cout << "pDriverPath = " << foundInfo[i].pDriverPath << endl;
}
// Print out numDriversExist references
printf("pcbNeeded = %d\n", pcbNeeded);
printf("numDriversExist = %d\n", numDriversExist);
}
// return true if the printer driver exists, else false
return true;
}
My question is that for my test cout statements, I'm always getting outputs that show a sequence of 8 hexadecimal numbers. Could that be b/c of the unicode business? Also, would there be any specific guidelines on finding a printer driver with a particular cell information?