Hi all,
Hope someone out there can help...
I'm having a problem trying to get the following test script to work under windows 8.1 64bit when compiled as 32 bit.
The 64bit compile works fine!?? Also, the 32 bit compile works fine on 32 bit...
I've found some information on the issue here
http://www.pinvoke.net/default.aspx/winspool/DocumentProperties.html
They refer to using 'IntPtr.Zero' which seems to be for C#.
More info here
https://msdn.microsoft.com/en-us/library/system.intptr.zero(v=vs.110).aspx
I'm sure the issue is with the data type set for the pointer to the devmode struct but I've tried everything I can think of.
Please see follow test script to show the issue.
Many thanks in advance
**Edit** Cleaned up first line of _DocumentProperties() function, as per JohnOne's comment below.
#include <Array.au3> #include <WinAPIEx.au3> ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sPrinterName = ' & $sPrinterName & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iDevModeSize = ' & $iDevModeSize & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ;Local $iTestBufferSize = _WinAPI_GetMemorySize($ptrDevMode) ;MsgBox(4096, "Memory Size", $iTestBufferSize) ;_WinAPI_DisplayStruct($tDevMode, $tagDEVMODE) _DocumentProperties(0, $sPrinterName, $tDevMode, $DM_OUT_DEFAULT) $tDevMode = 0 ;_ArrayDisplay($aResult) DllCall("Winspool.drv", "long", "GetDefaultPrinterW", "wstr", 0, "ptr", DllStructGetPtr($tBufferSize)) DllCall("Winspool.drv", "long", "GetDefaultPrinterW", "ptr", DllStructGetPtr($tPrinterName), "ptr", DllStructGetPtr($tBufferSize)) $tPrinterName = 0 $tBufferSize = 0 Return $sPrinter