Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using the Selprint Method of a RichText Control
Message
De
17/09/1999 11:32:28
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
16/09/1999 12:17:31
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00199808
Message ID:
00265949
Vues:
20
> 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"?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform