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 12:30:55
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
17/09/1999 11:32:28
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00199808
Message ID:
00265988
Vues:
16
>> 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"?


I don't know :( It has been a long time I tried it (worked under Win95). I had a test form for it but unfortunately coudn't find :(
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform