Hi,
right function declaration is:
[DllImport("user32.dll")] static extern int SetScrollInfo (IntPtr hwnd, int n, ref SCROLLINFO lpcScrollInfo, bool b);
I declared it like:
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)] static extern int SetScrollInfo (IntPtr hwnd, int n, SCROLLINFO lpcScrollInfo, bool b);
can it be the reason of Access violation exception?
Exception i have: Unhandled exception occured in UI thread System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Drawing.SafeNativeMethods.PrintDlg(PRINTDLGX86 lppd) at System.Drawing.Printing.PrinterSettings.GetDefaultPrinterName() at System.Drawing.Printing.PrinterSettings.get_PrinterNameInternal() at System.Drawing.Printing.PrinterSettings.get_PrinterName()