Add -DUNICODE to the wineg++ options. TCHAR is char without it.
I try as you said in my program as below:
#include <windows.h>
#include <stdio.h>
#include <wchar.h>
int main()
{
DWORD dwItems = 1;
TCHAR ptszIPAddress[32] = TEXT("125.216.242.251");
dwItems = (DWORD)wcslen((const wchar_t*)ptszIPAddress) + 1;
printf("dwItems %d\n", dwItems);
return 0;
}
but the result of the variable dwItems is 9, while in Windows environment is 16, why?
------------------ ������������������������ ------------------������������������: "Damjan Jovanovic"<damjan.jov@gmail.com>;������������������������: 2010������11������16������(������������������) ������������2:14������������������: "������������"<gengjia.ding@qq.com>;������������: "wine-devel"<wine-devel@winehq.org>;������������: Re: how to use wcslen() in wine?> Mailing Address: 339, Building C12, SCUT, GuangzhouHigher Education Mega Center, Guangzhou, ChinaTry:
wineg++ -I /usr/include/wine/include/msvcrt file.cpp -o file -lmsvcrt
2010/11/15 ������������ <gengjia.ding@qq.com>
>
>
>
> hello, I'm developing under Wine environment.
> 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.
> As it is described in "Winelib_User's_Guide":"In these cases you should use msvcrt to provide your C runtime calls.
> import msvcrt.dll
> to your applications .spec file."
> I'm using wineg++ to compile the .cpp & .h files, there is no .spec file, how can I import the DLL?
> May you please help me? Thanks very much!
>
>
> ------------------
> Where there is a will, there is a way!
> ------------------
> ������������������
> Gavin-Ding
> Computer Science and Technology������South China University of Technology
> Email: gj.ding@mail.scut.edu.cn
> gengjia.ding@gmail.com
> gengjia.ding@qq.com
> Postcode:510006
>
>
>
>
>