> IF PCount() < 3
> tcDoc = toRTF.SelRTF
> ENDIF
>
> *-----------------------------------------------
> * Print
> *-----------------------------------------------
> LOCAL lnHeap, lnDoc, lcStruct, lnHDC
> IF not Empty( lcPrinter )
> lnHDC = CreateDC("WINSPOOL",lcPrinter,0,0)
> lnHeap = HeapCreate(0, 8192, 8192)
> lnDoc = HeapAlloc( lnHeap, 0, Len(tcDoc)+1 )
> lstrcpy( lnDoc, tcDoc )
> lcStruct = ToInt(12)+ToInt(lnDoc)+ToInt(0)
> StartDoc( lnHDC, lcStruct )
> StartPage( lnHDC )
> toRTF.SelPrint( lnHDC )
> EndPage( lnHDC )
> EndDoc( lnHDC )
> DeleteDC( lnHDC )
> HeapFree(lnHeap, 0, lnDoc)
> HeapDestroy(lnHeap)
> ENDIF
>
> *==================================================
> * Convert into an integer
> *==================================================
>FUNCTION ToInt
> PARAMETER tnValue
> PRIVATE cString, nT
> cString =''
> FOR nT = 1 to 4
> cString = cString +Chr(tnValue%256)
> tnValue = Int(tnValue /256)
> ENDFOR
> RETURN cString
Cetin
Works, almost. Two things bother me: first, it gives me an "OLE error 0x80020010: invalid callee". If I choose to ignore this error, it goes with printing (so I figure the printer name I gave is correct), it prints couple of words of RTF codes, then several PCL commands, a blank page, another couple of RTF commands, and no text at all.
Could this have something to do with (whoever mentioned) "not tested under NT"?