Add -DUNICODE to the wineg++ options. TCHAR is char without it.<br><br><div class="gmail_quote">2010/11/17 飞翔 <span dir="ltr"><<a href="mailto:gengjia.ding@qq.com">gengjia.ding@qq.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table style="width:100% ! important;table-layout:fixed" width="100%" align="center" bgcolor="#f7ffee" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="background-repeat:no-repeat" height="74" valign="top" width="134">
</td><td valign="top" width="80%"> </td></tr></tbody></table><table style="width:100% ! important;table-layout:fixed" height="344" align="center" bgcolor="#f7ffee" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td valign="top" width="40">
<table style="width:100% ! important;table-layout:fixed" width="100%" align="center" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td height="81" valign="top"> </td></tr></tbody></table></td><td style="line-height:28px;font-size:12px;color:rgb(0, 0, 0)" valign="top" align="left">
<font size="4">I try as you said in my program as below:<br><font style="color:rgb(0, 0, 0)" size="2">#include <windows.h><br>#include <stdio.h><br>#include <wchar.h><br><br>int main()<br>{ <br> DWORD dwItems = 1;<br>
TCHAR ptszIPAddress[32] = TEXT("125.216.242.251");<br> dwItems = (DWORD)wcslen((const wchar_t*)ptszIPAddress) + 1;<br> printf("dwItems %d\n", dwItems);<br> return 0;<br>}</font><br>but the result of the variable dwItems is 9, while in Windows environment is 16, why?<br>
</font><div><font size="4"></font></div><div><font size="4"></font></div><div><font size="4"> </font></div></td><td valign="bottom" width="40"><table style="width:100% ! important;table-layout:fixed" width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td height="96" valign="top"> </td></tr></tbody></table></td></tr></tbody></table><table style="width:100% ! important;table-layout:fixed" width="100%" align="center" bgcolor="#f7ffee" border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td valign="bottom" width="75"> </td><td height="119" valign="bottom"> </td><td valign="bottom" width="217"> </td></tr></tbody></table><table style="font-size:0px;min-height:0px" border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td><br></td></tr></tbody></table><div><div> </div><div> </div><div style="color:rgb(0, 0, 0)"><div style="font-size:12px;font-family:Arial Narrow;padding:2px 0pt">------------------ 原始邮件 ------------------</div>
<div style="font-size:12px;background:none repeat scroll 0% 0% rgb(239, 239, 239);padding:8px"><div><b>发件人:</b> "Damjan Jovanovic"<<a href="mailto:damjan.jov@gmail.com" target="_blank">damjan.jov@gmail.com</a>>;</div>
<div><b>发送时间:</b> 2010年11月16日(星期二) 凌晨2:14</div><div><b>收件人:</b> "飞翔"<<a href="mailto:gengjia.ding@qq.com" target="_blank">gengjia.ding@qq.com</a>>; </div><div><b>抄送:</b> "wine-devel"<<a href="mailto:wine-devel@winehq.org" target="_blank">wine-devel@winehq.org</a>>; </div>
<div><b>主题:</b> Re: how to use wcslen() in wine?</div></div><div><div></div><div class="h5"><div> </div>Try:<br>wineg++ -I /usr/include/wine/include/msvcrt file.cpp -o file -lmsvcrt<br><br>2010/11/15 飞翔 <<a href="mailto:gengjia.ding@qq.com" target="_blank">gengjia.ding@qq.com</a>><br>
><br>><br>><br>> hello, I'm developing under Wine environment.<br>> I'm using Unicode and I want to be able to use standard library call wcslen, but I don't know how to change my C library from the native glibc C library to the msvcrt C library.<br>
> As it is described in "Winelib_User's_Guide":"In these cases you should use msvcrt to provide your C runtime calls.<br>> import msvcrt.dll<br>> to your applications .spec file."<br>> I'm using wineg++ to compile the .cpp & .h files, there is no .spec file, how can I import the DLL?<br>
> May you please help me? Thanks very much!<br>><br>><br>> ------------------<br>> Where there is a will, there is a way!<br>> ------------------<br>> 丁耿佳<br>> Gavin-Ding<br>> Computer Science and Technology,South China University of Technology<br>
> Email: <a href="mailto:gj.ding@mail.scut.edu.cn" target="_blank">gj.ding@mail.scut.edu.cn</a><br>> <a href="mailto:gengjia.ding@gmail.com" target="_blank">gengjia.ding@gmail.com</a><br>> <a href="mailto:gengjia.ding@qq.com" target="_blank">gengjia.ding@qq.com</a><br>
</div></div>> Mailing Address: 339, Building C12, SCUT, GuangzhouHigher Education Mega Center, Guangzhou, China<br>> Postcode:510006<br>><br>><br>><br>><br>><br></div></div></blockquote></div><br>