The problem occurs because when using a very large text there is a crash in the system because the internal functions of HMG to set/get text in the editbox does not support a very large text. In the next release I try fix.
I developed two functions to work with very long texts in EditBox control.
To work with very large texts must change:
Form_1.EditBox_1.Value := cHugeText
for:
MSG_SETTEXT (GetControlHandle("EditBox_1","Form_1"), cHugeText)
and:
cHugeText := Form_1.EditBox_1.Value
for:
cHugeText := MSG_GETTEXT (GetControlHandle("EditBox_1","Form_1"))
Code: Select all
#pragma BEGINDUMP
#define COMPILE_HMG_UNICODE
#include "HMG_UNICODE.h"
#include <windows.h>
#include <commctrl.h>
#include "hbapi.h"
HB_FUNC (MSG_SETTEXT)
{
SendMessage ((HWND) hb_parnl(1), WM_SETTEXT, 0, (LPARAM) HMG_parc(2));
}
HB_FUNC (MSG_GETTEXT)
{ UINT nLen = 0;
TCHAR *cText = NULL;
nLen = (UINT) SendMessage ((HWND) hb_parnl(1), WM_GETTEXTLENGTH, 0, 0);
if (nLen > 0)
{ cText = (TCHAR*) hb_xgrab ((nLen+1) * sizeof(TCHAR));
if (cText)
{ SendMessage ((HWND) hb_parnl(1), WM_GETTEXT, nLen+1, (LPARAM) cText);
HMG_retc( cText );
hb_xfree( cText );
}
else
HMG_retc(_TEXT(""));
}
else
HMG_retc(_TEXT(""));
}
#pragma ENDDUMP