From WikiChip
Editing mirc/dynamic-link library

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 45: Line 45:
  
  
If you call a non unicode dll with mIRC being unicode, mIRC must call the prototype with a char * and will convert its utf16 to utf8, and whenever this happens in mIRC, the data is chopped at $maxlenl+100 bytes.
+
If you call a non unicode dll with mIRC being unicode, mIRC must call the prototype with a char * and will convert its utf16 to utf8.
  
Both 'data' and 'params' are allocated with a number of bytes that is close to ($maxlenl+100)*2+N where N is 100 or a bit more, and this is true both unicode and non unicode mode. This effectively mean that you can write that many bytes into the buffer yourself in both mode.
+
Both 'data' and 'params' are allocated with a number of bytes that is close to ($maxlenl+100)*2+N where N is 100 or a bit more, currently 20782 bytes, and this is true both unicode and non unicode mode. This effectively mean that you can write that many bytes into the buffer.
 +
 
 +
HOWEVER, if you call a non unicode dll with mIRC being unicode, your input in 'data' is chopped at the LLL but in bytes, aka $maxlenl+100 bytes. Take $dll(dll.dll,function,$str($chr(10004),10000)):
 +
 
 +
If the dll is non unicode, 'data' will be utf8, the 10000 $chr(10004) in utf16 are converted to utf8, going from 20000 bytes to 30000 ($chr(10004) takes 3 bytes in utf8), and then those 30000 bytes are chopped down to $maxlenl+100
 +
 
 +
If the dll is unicode, the input is not chopped and you can get the 'normal' maximum $maxlenl+100 chars in 'data'.
  
 
These functions must use the [[stdcall calling convention]]. (This is also the standard calling convention for all other [[Microsoft]] [[Win32 API]] functions.)
 
These functions must use the [[stdcall calling convention]]. (This is also the standard calling convention for all other [[Microsoft]] [[Win32 API]] functions.)

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)