I stopped using DarkInk a year or so ago because it gave me various problems when printing large images, or when used continuously for a long period of time. You get nice purple error boxes that your program cannot trap or handle. I wrote a set of printer functions from scratch, the function I use to get the default printer is below if it's any use.
#constant _WINSPOOL 1
load dll "winspool.drv",_WINSPOOL
prn$=getDefaultPrinter()
print prn$
wait key
end
Function getDefaultPrinter()
`***************************************************************************************************************************************************************
`Gets the default printer name (if any)
`Returns a string containing the windows printer name, or blank string if the call fails or no default printer is set
`See: http://msdn.microsoft.com/en-us/library/windows/desktop/dd144876%28v=vs.85%29.aspx
local prnName$ as string = ""
local pcchBufPtr as dword
local pszBufPtr as dword
pcchBufPtr=alloc zeroed(4) `Allocate buffer to get required string buffer size
success=call dll(_WINSPOOL,"GetDefaultPrinterA",0,pcchBufPtr) `Request buffer size (pszBuffer=0)
`Continue if dll call failed & returned the required buffer size
if success=0 and (*pcchBufPtr)>0
pszBufPtr=alloc zeroed(*pcchBufPtr) `Allocate buffer required for printer name string
success=call dll(_WINSPOOL,"GetDefaultPrinterA",pszBufPtr,pcchBufPtr) `Get default printer name
if success<>0 and (*pcchBufPtr)>0 then prnName$=peek string(pszBufPtr) `Copy string if call was successful, and got valid returned buffer size
free pszBufPtr
endif
free pcchBufPtr
EndFunction prnName$
Requires Matrix1utils.
Edit: Speeling