convert TCHAR[] to BYTE*
-
Hi , can anyone guide me how to convert content of type TCHAR[] to BYTE*.... Thanks, Rakesh.
Use the WideCharToMultiByte[^] function.
«_Superman_» I love work. It gives me something to do between weekends.
-
Use the WideCharToMultiByte[^] function.
«_Superman_» I love work. It gives me something to do between weekends.
But its saying like Widechartomultibyte cannot convert 5 parameter from BYTE[128] to LPSTR.. code: WCHAR szstring[256]; length = lstrlen(szstring); BYTE pByte[128]; WideCharToMultiByte(CP_ACP, 0, szstring, -1, pByte, length, NULL, NULL); Can you please guide me where am i going wrong? Thanks, Rakesh.
-
But its saying like Widechartomultibyte cannot convert 5 parameter from BYTE[128] to LPSTR.. code: WCHAR szstring[256]; length = lstrlen(szstring); BYTE pByte[128]; WideCharToMultiByte(CP_ACP, 0, szstring, -1, pByte, length, NULL, NULL); Can you please guide me where am i going wrong? Thanks, Rakesh.
The expected 5th parameter is
char*
and you're giving it anunsigned char*
. All you need to do is typecastpByte
as(LPSTR)pByte
.«_Superman_» I love work. It gives me something to do between weekends.
-
The expected 5th parameter is
char*
and you're giving it anunsigned char*
. All you need to do is typecastpByte
as(LPSTR)pByte
.«_Superman_» I love work. It gives me something to do between weekends.
hey superman, sorry to disturb u.. i tried with tat too(before replying u..) i forgot to mention tat one... Its not copying the exact content rather its showing "???" marks... i actually tried to copy chinese characters.. can u please help me to solve this issue? thanks, rakesh.
-
hey superman, sorry to disturb u.. i tried with tat too(before replying u..) i forgot to mention tat one... Its not copying the exact content rather its showing "???" marks... i actually tried to copy chinese characters.. can u please help me to solve this issue? thanks, rakesh.
[Message Deleted]
-
[Message Deleted]
-
hey superman, sorry to disturb u.. i tried with tat too(before replying u..) i forgot to mention tat one... Its not copying the exact content rather its showing "???" marks... i actually tried to copy chinese characters.. can u please help me to solve this issue? thanks, rakesh.
Rakesh5 wrote:
...its showing "???" marks...
Where?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons