RICHEDIT

RICHEDIT

Postby MarcoBoschi » Mon Feb 28, 2011 1:03 pm

I have this problem.
The only TRichedit based program workink is testrich.prg
For instance enrico91.prg and other samples don't work

enrico91.prg

#include "Fivewin.ch"
#include "Richedit.ch"


FUNCTION MAIN()

LOCAL hDll := LOADLIBRARY( "RICHED20.DLL" )
LOCAL oDlg, oRich, cVar := ""

DEFINE DIALOG oDlg

@ 0, 0 RICHEDIT oRich VAR cVar

ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetControl( oRich ) ;
CENTER
? cVar // nothink

FREELIBRARY( hDll )

RETURN NIL

this is created by me



FUNCTION CREANOTE( )

LOCAL oDlg
LOCAL oRich
LOCAL lNuovo := .F.
LOCAL aUtenti := {}
LOCAL oButSalva

LOCAL cLettore := SPACE(20)
LOCAL nBckColor := CLR_WHITE
local hRichDLL := LoadLibrary( "riched20.dll" )

DEFINE DIALOG oDlg RESOURCE "nota" TITLE "Nuova nota"

REDEFINE BUTTON oButSalva ID 201 OF oDlg ACTION oDlg:End( IDOK )

oRich = TRichEdit():Redefine( 101, { || "" }, oDlg )
oRich:lHighLight = .f.

ACTIVATE DIALOG oDlg CENTERED

IF oDlg:nResult = IDOK

? oRich:SaveAsRTF( oRich )
ENDIF


The question si

WHY?


marco


FreeLibrary( hRichDLL )
RETURN NIL
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: RICHEDIT SOLVED

Postby MarcoBoschi » Mon Feb 28, 2011 2:02 pm

I have to store this before Dialog end

REDEFINE BUTTON oButSalva ID 201 OF oDlg ;
ACTION ( cRich := oRich:SaveAsRTF( oRich ) , ;
oDlg:End( IDOK ) )

ACTIVATE DIALOG oDlg CENTER

? cRich
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 78 guests