The error occurs in the SysUnicode.pas unit, IsCharMsgAlreadyUnicode function. It seems that the way UniSynEdit checks if char messages are already Unicode doesn't work in a DLL.
Given that the result of the function is False if not csDesigning:
Code: Select all
Result := CharMsgIsUnicode and (csDesigning in ComponentState);
Code: Select all
if (csDesigning in Application.ComponentState) then
begin
{$IFNDEF SYN_COMPILER_9_UP}
with TUnicodeControl.Create(Application) do
try
ParentWindow := Application.Handle;
// post a WideChar that cannot be converted to an AnsiChar
PostMessageW(Handle, WM_CHAR, WideCharTestValue, 0);
Application.ProcessMessages;
Result := CharMsgIsUnicode and (csDesigning in ComponentState);
finally
Free
end;
{$ELSE}
Result := True;
{$ENDIF}
end
else
Result := True;