Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

OpenPrinter MSDN API


1 reply to this topic

lmilesuk

lmilesuk
  • Full Members
  • 1 posts

Posted 27 January 2015 - 09:49

Hi,

 

I've tried everything I can think of but I'm unable to get OpenPrinter API to work in my BasicMsi

prototype BOOL SETUPAPI.OpenPrinterW(
 WSTRING, //_In_   LPTSTR pPrinterName,
 NUMBER,//_Out_  LPHANDLE phPrinter,
 WPOINTER//_In_   LPPRINTER_DEFAULTS pDefault
);
try
	OpenPrinterW(szDriverName, Printer, NULL);
	
	
catch
	Err = GetLastError();
	SprintfBox (INFORMATION, "L862Error","Error occured: %i\n\n%s\n\n%s", Err.Number, Err.Description, Err.LastDllError); 
	
endcatch;

I always get a -2147219709 returned, I've also tried using OpenPrinterA and OpenPrinter but same error everytime.

 

Does anyone have any idea's as to what I may be doing wrong?



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 28 January 2015 - 13:00

Download the free Dependecy Walker tool from http://dependencywalker.com/

Load the DLL in this tool and look at the exports to see how the exporterd function is actaully called.