mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2008
Posts: 93
B
BhaaL Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Mar 2008
Posts: 93
While updating my DLL to work with 7.1, I noticed that the topics "DLL Support" and (especially) "SendMessage" are not as precise as they probably should be.

DLL Support includes the new LOADINFO.mUnicode switch, but it should probably also contain notes about function signatures in combination with it.
mUnicode = false should have
Code:
int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)

as the docs describe.
However, mUnicode = true makes more sense with
Code:
int __stdcall procname(HWND mWnd, HWND aWnd, wchar_t *data, wchar_t *parms, BOOL show, BOOL nopause)

Mixing signatures with mUnicode will most likely result in incomplete and/or garbled text (unicode in char* clips after the first char, single-byte in wchar_t* looks probably off).

SendMessage is the one i stumbled over after dealing with the problems above: The mapped file must still written to in single-byte, regardless of mUnicode!
Even now when both mIRC 7.1 and my DLL are compiled as unicode apps, that part uses plain char* stuff to send commands around - otherwise mIRC seems to completely ignore it. Bug or intended?

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Originally Posted By: BhaaL
SendMessage is the one i stumbled over after dealing with the problems above: The mapped file must still written to in single-byte, regardless of mUnicode!

The details are hidden in versions.txt, but the support is there:

Originally Posted By: versions.txt
02/04/2010 - mIRC v7.0

53.Added SendMessage WM_MEVALUATE/WM_MCOMMAND support for Unicode.
By default mIRC assumes that mapped file data is ANSI for backwards
compatibility. However an application can "or" the value 8 in the
cMethod parameter to specify Unicode data.


Edit: Actually this is also documented in /help SendMessage.

Last edited by Collective; 04/08/10 03:51 PM.
Joined: Mar 2008
Posts: 93
B
BhaaL Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Mar 2008
Posts: 93
Ah, thanks for the pointer. I did read over that part, but obviously forgot it.
Anyone agrees this should still be in the helpfile aswell?

Edit: And now that you mention it, it really is there. At least in the 7.1 docs. Strange, my testing mIRC installation still had a 6.35 helpfile without it smile

Last edited by BhaaL; 04/08/10 03:53 PM.

Link Copied to Clipboard