Re: FindNextPrinterChangeNotification and pPrinterNotifyInfo confusion

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Bård (Kalbakk_at_gmail.com)
Date: 01/26/05


Date: Wed, 26 Jan 2005 22:58:45 GMT


>>[DllImport("winspool.drv",
>>EntryPoint="FindNextPrinterChangeNotification", SetLastError=true)]
>>public static extern int FindNextPrinterChangeNotification(int
>>hChange, out PRINTER_NOTIFY_OPTIONS pdwChange, IntPtr pvReserved, out
>>IntPtr ppPrinterNotifyInfo);
>
> That doesn't look right, make it
>
> public static extern bool FindNextPrinterChangeNotification(IntPtr
> hChange, out uint pdwChange, ref PRINTER_NOTIFY_OPTIONS
> pPrinterNotifyOptions, out IntPtr ppPrinterNotifyInfo);
>
>
>
> Mattias

Same problem. ppPrinterNotifyInfo doesn't contain any data.
pdwChange is set, but not ppPrinterNotifyInfo.
Alltough there seem to be a problem with pPrinterNotifyOptions , when I
initialise it as above FindNextPrinterChangeNotificatio returns win32 error
6 ("Invalid reference" if I translate it to English from my native
language).
When I tested c++ code ppPrinterNotifyInfo was filled with data wether or
not I passed ppPrinterNotifyInfo as NULL.

Bård