Sending a _PRINTER_INFO_2A to a dll
Posted: Tue Apr 22, 2008 12:32 pm
I have a problem with installing a printer using "AddPrinterA" Api function. this function needs a pointer to a _PRINTER_INFO_2A object, so we have to create this object first, set it's fields and send it through AddPrinterA.
for example in delphi we can do this:
var
PrinterInfo : ^PRINTER_INFO_2A
begin
...
PrinterInfo^.pPortName := pchar('FILE:')
PrinterInfo^.pPrinterName:= pchar(sName);
...
AddPrinterA(nil, 2, PrinterInfo);
end;
I wonder if and how we can create this object in IA to use AddPrinterA function
for example in delphi we can do this:
var
PrinterInfo : ^PRINTER_INFO_2A
begin
...
PrinterInfo^.pPortName := pchar('FILE:')
PrinterInfo^.pPrinterName:= pchar(sName);
...
AddPrinterA(nil, 2, PrinterInfo);
end;
I wonder if and how we can create this object in IA to use AddPrinterA function