oRich:LoadFromRTFFile() ya no funciona, no carga nada:
- Code: Select all Expand view
- #Include "FiveWin.ch"
#include "richedit.ch"
//----------------------------------------------------------------------------//
Function Main()
Local oDlg, oRich, cRtf
Local hRichDLL := LoadLibrary( "riched20.dll" )
local lBold := .F., nPos := 0
cRtf:="{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}}"+CRLF+;
"{\colortbl ;\red0\green77\blue187;\red192\green80\blue77;}"+CRLF+;
"{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\cf1\lang1031\f0\fs22 This is \b colored \b0 text\cf0 . \cf2 The background is color 1 and the foreground is color 2\cf0\par"+CRLF+CRLF+;
"}"
DEFINE DIALOG oDlg NAME "Test"
REDEFINE RICHEDIT oRich VAR cRTF OF oDlg ID 100
REDEFINE BUTTON ID 110 ACTION ( oRich:LoadFromRTFFile( cGetFile( "Archivo RTF (*.rtf) | *.rtf" ) ), oRich:SetFocus() )
REDEFINE BUTTON ID 120 ACTION ( lBold := ! lBold, ;
oRich:SetBold( lBold ), oDlg:Update(), oRich:SetFocus(), oDlg:cTitle := "IsBold "+cValtoChar(lBold) )
oRich:SetText( cRtf )
ACTIVATE DIALOG oDlg CENTERED
FreeLibrary( hRichDLL )
Return nil
.rc
- Code: Select all Expand view
- #define IDC_EDIT1 101
Test DIALOG 41, 64, 409, 199
STYLE DS_MODALFRAME | 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Testing the RichEdit control"
FONT 8, "MS Sans Serif"
{
CONTROL "", 100, "RichEdit20A", 4100 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 6, 12, 398, 163
PUSHBUTTON "&Load text file", 110, 5, 179, 50, 16
PUSHBUTTON "&Bold", 120, 95, 179, 50, 16
}
Muchas gracias.
Un saludo