Hi José,
Looks like you may have missed changing the DWORD in the following function in AfxRichEdit.inc
Might want to change it to "BYVAL lpcf AS CHARFORMATW PTR" and then "cast(LPARAM, lpcf)" for the LPARAM in the in the SendMessage.
' ========================================================================================
' Sets character formatting in a rich edit control.
' ========================================================================================
PRIVATE FUNCTION RichEdit_SetCharFormat (BYVAL hRichEdit AS HWND, BYVAL chfmt AS DWORD, BYVAL pchfmt AS DWORD) AS LONG
FUNCTION = SendMessageW(hRichEdit, EM_SETCHARFORMAT, chfmt, pchfmt)
END FUNCTION
' ========================================================================================
Right you are. I have modified it to:
' ========================================================================================
' Sets character formatting in a rich edit control.
' ========================================================================================
PRIVATE FUNCTION RichEdit_SetCharFormat (BYVAL hRichEdit AS HWND, BYVAL chfmt AS DWORD, BYVAL lpcf AS CHARFORMATW PTR) AS LONG
FUNCTION = SendMessageW(hRichEdit, EM_SETCHARFORMAT, chfmt, lpcf)
END FUNCTION
' ========================================================================================
Thanks José,
When I used your new files and compiled the WinFBE Editor source code, this RichEdit_SetCharFormat function throws a "pointer passed as scalar" warning, so you might want to update the code to do the cast.
FUNCTION = SendMessageW(hRichEdit, EM_SETCHARFORMAT, chfmt, Cast(LPARAM, lpcf))
Done.
Thanks José appreciate it