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

C / C++ / MFC

 
GeneralRe: SetDlgItemTextW problem Pin
Suneet.0316-Jul-07 0:26
Suneet.0316-Jul-07 0:26 
GeneralRe: SetDlgItemTextW problem Pin
toxcct16-Jul-07 0:33
toxcct16-Jul-07 0:33 
AnswerRe: SetDlgItemTextW problem Pin
spsharma16-Jul-07 0:26
spsharma16-Jul-07 0:26 
GeneralRe: SetDlgItemTextW problem Pin
toxcct16-Jul-07 0:34
toxcct16-Jul-07 0:34 
GeneralRe: SetDlgItemTextW problem Pin
spsharma16-Jul-07 1:16
spsharma16-Jul-07 1:16 
AnswerRe: SetDlgItemTextW problem Pin
toxcct16-Jul-07 0:32
toxcct16-Jul-07 0:32 
GeneralRe: SetDlgItemTextW problem [modified] Pin
James R. Twine16-Jul-07 1:36
James R. Twine16-Jul-07 1:36 
AnswerRe: SetDlgItemTextW problem Pin
James R. Twine16-Jul-07 1:47
James R. Twine16-Jul-07 1:47 
   Assuming that pc_char is a suitable char buffer, the conversion to Unicode looks OK from here.

   I would try a few things...

     1: Remove the CString usage - it is not necessary and only adds time and another point for exception handling. 
LPCTSTR pcData = "Name";
wchar_t wcaBuf[255];
 
::mbstowcs( wcaBuf, cpData, ::_tcslen( cpData ) );
::SetDlgItemTextW( hWnd, IDC_VIEW , wcaBuf );
<code>// HWND hWndView = ::GetDlgItem( hWnd, IDC_VIEW );
//::SetWindowTextW( hWndView, wcaBuf );</code>
     2: Make sure that the conversion to Unicode was successful by checking the return value from mbstowcs(...)
     3: Check the return value of SetDlgItemTextW(...), and maybe try using SetWindowTextW(...) by first obtaining the HWND of the IDC_VIEW control.
     4: This may be a stupid question, but are you sure that IDC_VIEW is a "text-able" control (edit, button, static/label, drop-list combobox)?

   Peace!

-=- James
Please rate this message - let me know if I helped or not!<HR>If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
See DeleteFXPFiles

AnswerRe: SetDlgItemTextW problem Pin
Mark Salsbery16-Jul-07 6:07
Mark Salsbery16-Jul-07 6:07 
AnswerRe: SetDlgItemTextW problem Pin
Mark Salsbery16-Jul-07 6:12
Mark Salsbery16-Jul-07 6:12 
GeneralRe: SetDlgItemTextW problem Pin
James R. Twine16-Jul-07 6:34
James R. Twine16-Jul-07 6:34 
GeneralRe: SetDlgItemTextW problem Pin
Mark Salsbery16-Jul-07 6:35
Mark Salsbery16-Jul-07 6:35 
AnswerRe: SetDlgItemTextW problem Pin
Suneet.0316-Jul-07 18:55
Suneet.0316-Jul-07 18:55 
QuestionChange button name of FIle dialog Pin
CodeMak15-Jul-07 23:22
CodeMak15-Jul-07 23:22 
AnswerRe: Change button name of FIle dialog Pin
ThatsAlok16-Jul-07 0:24
ThatsAlok16-Jul-07 0:24 
AnswerRe: Change button name of FIle dialog Pin
David Crow16-Jul-07 4:00
David Crow16-Jul-07 4:00 
GeneralRe: Change button name of FIle dialog Pin
ThatsAlok16-Jul-07 20:49
ThatsAlok16-Jul-07 20:49 
GeneralRe: Change button name of FIle dialog Pin
David Crow17-Jul-07 2:28
David Crow17-Jul-07 2:28 
GeneralRe: Change button name of FIle dialog Pin
ThatsAlok17-Jul-07 6:46
ThatsAlok17-Jul-07 6:46 
AnswerRe: Change button name of FIle dialog Pin
Hamid_RT25-Jul-07 7:19
Hamid_RT25-Jul-07 7:19 
QuestionHow to make a lzh file manually! Pin
snake77715-Jul-07 22:15
snake77715-Jul-07 22:15 
Questionwhy does my activex control register unsuccessfully? Pin
eraccn15-Jul-07 21:46
eraccn15-Jul-07 21:46 
AnswerRe: why does my activex control register unsuccessfully? Pin
Suneet.0316-Jul-07 1:07
Suneet.0316-Jul-07 1:07 
AnswerRe: why does my activex control register unsuccessfully? Pin
bob1697216-Jul-07 6:31
bob1697216-Jul-07 6:31 
GeneralRe: why does my activex control register unsuccessfully? Pin
eraccn18-Jul-07 3:39
eraccn18-Jul-07 3:39 

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.