To All
This is my first try at RichEdit ... I have an Ms Access table with an attribute set to Text .. I have no problem saving plain text or retrieving plain text and Add\Editing it using MEMO.. However, Using the same basic Principal from richedit.ch .. I can Redefine the object and variable .. however I cannot get the code to reveal any text in my dialog box .. I know the cRtf variable has content .. see image, but the variable never resolves in the Dialog .. Here is my code:
Memo.Rc


Any Ideas ??
Rick Lipkin
This is my first try at RichEdit ... I have an Ms Access table with an attribute set to Text .. I have no problem saving plain text or retrieving plain text and Add\Editing it using MEMO.. However, Using the same basic Principal from richedit.ch .. I can Redefine the object and variable .. however I cannot get the code to reveal any text in my dialog box .. I know the cRtf variable has content .. see image, but the variable never resolves in the Dialog .. Here is my code:
Try
聽 hRichDll := LoadLibrary( "riched20.dll" )
Catch
聽 聽Return(.f.)
ENd Try
cLetter 聽 聽 聽:= oRsLetter:Fields("BODY"):Value
..
..
..
REDEFINE BTNBMP oButt3 PROMPT cRtPrompt ID 123 of oDlg LEFT 2007 ; 聽// letter
聽 聽 聽 聽 聽RESOURCE "LETTER32";
聽 聽 聽 聽 聽ACTION ( _ViewMemo( cMode, Substr(cName,1,30), oRsLetter, oButt3, @cRtPrompt, @cLetter ));
聽 聽 聽 聽 GRADIENT DarkGreyButtonGrad()
//-----------------------------
Static FUNC _ViewMemo( cMODE, cTitle, oRsLetter, oButt3, cRtPrompt, cLetter )
Local SAYING, oUSERS
Local oRTF, cRTF, oBtn1,oBtn2
Local lOk,nLen,cOldMemo
Lok 聽 聽 聽:= .f.
cOldMemo := cLetter
If empty( cTitle )
聽 聽cTitle := "Text Viewer"
Endif
Do Case
Case cMode = "E"
聽 聽 聽cTITLE := cTitle +" 聽 聽 EDIT"
Case cMode = "A"
聽 聽 聽cTITLE := cTitle +" 聽 聽 聽ADD"
Case cMode = "V"
聽 聽 聽cTITLE := cTitle +" 聽 聽 VIEW"
EndCase
cRtf := cLetter
msginfo( cRtf ) 聽 // have content here
SetDlgGradient() 聽// reset to blank
DEFINE DIALOG oUSERS RESOURCE "MEMO" ;
聽 聽 聽 聽TITLE cTITLE 聽 聽 聽 聽 聽 聽 聽;
IF cMODE = "E" .or. cMode = "A"
聽 聽
聽 聽REDEFINE RICHEDIT oRtf VAR cRtf ID 130 of oUSERS //UPDATE
ELSE 聽 聽 // view
聽 聽REDEFINE RICHEDIT oRtf VAR cRtf ID 130 of oUSERS READONLY //COLOR CLR_BLACK, 15987697 READONLY
ENDIF
REDEFINE BTNBMP oBtn1 ID 111 of oUSERS 聽 ; 聽 聽 // ok
聽 聽 聽 聽 聽RESOURCE "OK", "DOK", "DOK" ;
聽 聽 聽 聽 聽PROMPT "&Ok" LEFT 2007;
聽 聽 聽 聽 聽ACTION ( lOk := .t.,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 If( lOk = .t., cLetter := cRtf, ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 If( lOk = .t., oUSERS:END(),) 聽)
REDEFINE BTNBMP oBtn2 ID 112 of oUSERS 聽 ; 聽 聽// cancel
聽 聽 聽 聽 聽RESOURCE "CANCEL", "DCANCEL", "DCANCEL" ;
聽 聽 聽 聽 聽PROMPT "&Cancel" LEFT 2007;
聽 聽 聽 聽 聽ACTION lOk := .f., oUSERS:END()
ACTIVATE DIALOG oUSERS 聽;
聽 聽 聽ON INIT ( oUsers:Move(100,250) );
聽 聽 聽VALID (!GETKEYSTATE( 27 )) ; 聽// do not allow esc key here
If cMode = "V"
聽 聽cLetter := cOldMemo
Endif
If lOk = .t.
聽 聽nLen 聽:= Len( cLetter )
聽 聽Do Case
聽 聽Case nLen = 0
聽 聽 聽 聽 cRtPrompt := "Create Letter"
聽 聽Case nLen > 0
聽 聽 聽 聽 cRtPrompt := "View Letter"
聽 聽End Case
聽 聽oButt3:cCAPTION := cRtPrompt
聽 聽* oBtn3:SetColor( "R+/W*" )
聽 聽oButt3:ReFresh()
ENdif
LightGreyGrad()
RETURN( NIL )Memo.Rc
// Generated by ResEdit 1.6.6
// Copyright (C) 2006-2015
// <!-- m --><a class="postlink" href="http://www.resedit.net">http://www.resedit.net</a><!-- m -->
#include <windows.h>
#include <commctrl.h>
MEMO DIALOG 13, 35, 387, 303
STYLE WS_POPUP | WS_CAPTION
FONT 6, "MS Sans Serif"
{
聽LTEXT "Text", -1, 2, 9, 21, 8
聽EDITTEXT 130, 25, 8, 355, 245, ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_BORDER | WS_VSCROLL | WS_TABSTOP
聽CONTROL "Ok", 111, "TBtnBmp", 32 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 281, 265, 41, 25
聽CONTROL "Cancel", 112, "TBtnBmp", 32 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 327, 265, 41, 25
}

Any Ideas ??
Rick Lipkin
