本文整理自网络,侵删。
function StrLenWide(const Str: PWideChar): Cardinal;asm {Check the first byte} cmp word ptr [eax], 0 je @ZeroLength {Get the negative of the string start in edx} mov edx, eax neg edx@ScanLoop: mov cx, [eax] add eax, 2 test cx, cx jnz @ScanLoop lea eax, [eax + edx - 2] shr eax, 1 ret@ZeroLength: xor eax, eaxend;
相关阅读 >>
Delphi android实例-退出程序(xe8+小米2)
Delphi下用cdo发送邮箱实例(授权码cdo发送邮箱的解决办法)
Delphi winapi: getdesktopwindow - 返回桌面窗口的句柄
Delphi2010中使用pchar时e2010 incompatible types: 'char' and 'ansichar' 错误的处理
Delphi winapi: flashwindow - 闪烁窗口
更多相关阅读请进入《Delphi》频道 >>