Sending a _PRINTER_INFO_2A to a dll

Got a problem you cannot solve? Try here.
mehran
Posts: 20
Joined: Tue Apr 22, 2008 12:17 pm
Location: Canada

Sending a _PRINTER_INFO_2A to a dll

Postby mehran » 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

Mateo
Posts: 20
Joined: Tue Aug 21, 2007 10:15 am

Postby Mateo » Mon May 05, 2008 10:45 am

Sorry for the late reply.
No, I don't think you can create data structures in IA. What I did to get around this was write a couple of functions in a dll and then call the functions from IA using the Call DLL Function plug-in. Once you're in your function you can do pretty much whatever you want. I used C but you can use Delphi too as far as i know.

mehran
Posts: 20
Joined: Tue Apr 22, 2008 12:17 pm
Location: Canada

Thank you

Postby mehran » Mon May 05, 2008 11:28 am

Thank you for the answer, I'm gonna try this.


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 60 guests