[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Patch] Replace deprecated WSAStringToAddressA
[Thread Prev] | [Thread Next]
- Subject: Re: [Patch] Replace deprecated WSAStringToAddressA
- From: Chris Ruehl <chris.ruehl@xxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 7 Jun 2017 14:41:05 +0800
- To: libssh@xxxxxxxxxx
On Wednesday, June 07, 2017 02:32 PM, Chris Ruehl wrote:
On Wednesday, June 07, 2017 02:09 PM, Aris Adamantiadis wrote:On 7/06/17 07:40, Chris Ruehl wrote:- rc = WSAStringToAddressA((LPSTR) str, + rc = WSAStringToAddressW((LPWSTR) str,Hi Chris, Does the cast from char * to LPWSTR really work that way? I'm not very well experienced in Windows programming but if I recall properly you're supposed to convert the C string into a unicode wide string before using the -W family functions. Am I mistaken? Thanks, ArisI'd linked it with my application where I use the pure IP-address to connect to a host. Verified its works well. I used QTCreator which shows the parameter list so I used it for the cast. I don't want to open the box and change all to wchar_t :o) Chris
size_t size = strlen(str); wchar_t* wArr = new wchar_t[size]; for (size_t i = 0; i < size; ++i) wArr[i] = str[i]; and using wArr for str in the function without a cast Chris
RE: [Patch] Replace deprecated WSAStringToAddressA | Jason Curl <jason@xxxxxxxxxxxxxxxxxxxxxxxx> |
[Patch] Replace deprecated WSAStringToAddressA | Chris Ruehl <chris.ruehl@xxxxxxxxxxxx> |
Re: [Patch] Replace deprecated WSAStringToAddressA | Aris Adamantiadis <aris@xxxxxxxxxxxx> |
Re: [Patch] Replace deprecated WSAStringToAddressA | Chris Ruehl <chris.ruehl@xxxxxxxxxxxx> |