I have a dll coded in Delphi XE2 with the following code:
procedure xMain(MSG:String);export;
begin
MessageBox(0,PWideChar(MSG),'Title',0);
end;
exports xMain;
Now, I am importing this function in a FASM application like so:
library dllfile, "testdll.dll"
import dllfile,\
xMain, "xMain"
And utilizing is as so:
section ".data" data readable writeable
szMSG db "Message from FASM application!",0
section ".code" code readable executable
invoke xMain,szMSG
But the resulting messagebox appears with distorted characters as so:

That is the exact result of the function call.
How do I go about solving this issue?
Here are two working samples (using FASM 1.70.03 for Windows):
Ansi version,
dll:
exe:
Unicode version,
dll:
exe: