Click here to Skip to main content
15,914,071 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: converting TCHAR to LPVOID Pin
pnpfriend24-May-04 9:05
pnpfriend24-May-04 9:05 
GeneralRe: converting TCHAR to LPVOID Pin
David Crow24-May-04 9:49
David Crow24-May-04 9:49 
GeneralRe: converting TCHAR to LPVOID Pin
pnpfriend24-May-04 10:49
pnpfriend24-May-04 10:49 
GeneralRe: converting TCHAR to LPVOID Pin
David Crow24-May-04 10:52
David Crow24-May-04 10:52 
GeneralRe: converting TCHAR to LPVOID Pin
pnpfriend24-May-04 9:19
pnpfriend24-May-04 9:19 
GeneralRe: converting TCHAR to LPVOID Pin
Michael Dunn24-May-04 11:04
sitebuilderMichael Dunn24-May-04 11:04 
GeneralRe: converting TCHAR to LPVOID Pin
pnpfriend25-May-04 7:59
pnpfriend25-May-04 7:59 
GeneralRe: converting TCHAR to LPVOID Pin
Blake Miller25-May-04 15:11
Blake Miller25-May-04 15:11 
If one program is UNICODE and the other is ANSI, then you have to decide on your protocol.

I see you have two choices:

1. App1 SENDS Unicode and App2 CONVERT the Unicode to ANSI. If App1 RECEIVES a message from App2, then App1 must conver the Ansi sent by App2 back to Unicode.

2. App1 CONVERTS Unicode to ANSI and sends ANSI to App2. If App1 RECEIVES a message from App2, then App1 must converts the Ansi back to Unicode.

You need to investigate WideCharToMultiByte (UNICODE to ANSI) and MuliByteToWideChar (ANSI to UNICODE) string conversion functions.

Also, you might want to SEND the NUL terminator along with your string, although it is not strivtly necessary as long as you add one at the receiving end.

fSuccess = WriteFile( hPipe, chBuf, (_tcslen(chBuf) + 1) * sizeof(TCHAR), &cbWritten, NULL);
GeneralSetWindowsHookEx, SC_SCREENSAVE and mouse moves Pin
caykahve24-May-04 6:01
caykahve24-May-04 6:01 
GeneralRe: SetWindowsHookEx, SC_SCREENSAVE and mouse moves Pin
jmkhael24-May-04 6:19
jmkhael24-May-04 6:19 
GeneralRe: SetWindowsHookEx, SC_SCREENSAVE and mouse moves Pin
caykahve24-May-04 21:32
caykahve24-May-04 21:32 
GeneralRe: SetWindowsHookEx, SC_SCREENSAVE and mouse moves Pin
jmkhael24-May-04 22:41
jmkhael24-May-04 22:41 
GeneralProblem adding ActiveX to an MFC DLL Pin
Aviv Halperin24-May-04 5:58
Aviv Halperin24-May-04 5:58 
GeneralRe: Problem adding ActiveX to an MFC DLL Pin
igor196024-May-04 8:36
igor196024-May-04 8:36 
GeneralExcel 97 Automation Pin
act_x24-May-04 4:35
act_x24-May-04 4:35 
GeneralHTMLDocument and scripts Pin
Aggtaa24-May-04 4:11
Aggtaa24-May-04 4:11 
GeneralQuestions about Unicode Pin
Xiangyang Liu 刘向阳24-May-04 2:58
Xiangyang Liu 刘向阳24-May-04 2:58 
GeneralRe: Questions about Unicode Pin
Ravi Bhavnani24-May-04 4:21
professionalRavi Bhavnani24-May-04 4:21 
GeneralRe: Questions about Unicode Pin
Xiangyang Liu 刘向阳24-May-04 4:31
Xiangyang Liu 刘向阳24-May-04 4:31 
GeneralRe: Questions about Unicode Pin
wb24-May-04 4:59
wb24-May-04 4:59 
GeneralRe: Questions about Unicode Pin
Xiangyang Liu 刘向阳25-May-04 1:20
Xiangyang Liu 刘向阳25-May-04 1:20 
GeneralRe: Questions about Unicode Pin
Ravi Bhavnani24-May-04 9:04
professionalRavi Bhavnani24-May-04 9:04 
GeneralRe: Questions about Unicode Pin
Xiangyang Liu 刘向阳25-May-04 1:19
Xiangyang Liu 刘向阳25-May-04 1:19 
GeneralRe: Questions about Unicode Pin
Ravi Bhavnani25-May-04 1:21
professionalRavi Bhavnani25-May-04 1:21 
GeneralRe: Questions about Unicode Pin
Michael Dunn24-May-04 11:05
sitebuilderMichael Dunn24-May-04 11:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.