about LPARAM tranfs to char

Started by
0 comments, last by Buckeye 15 years, 9 months ago
hello everybody . I want to transform LPARAM to char * in this code LRESULT CALLBACK d3d::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch( msg ) { case WM_CHAR: strcpy(mesgg,(LPCTSTR)lParam); break; case WM_KEYDOWN: if( wParam == VK_ESCAPE ) ::DestroyWindow(hwnd); break; } return ::DefWindowProc(hwnd, msg, wParam, lParam); } but it cant ok. how can I do it? thanks
Advertisement
If you're using standard windows messaging, lParam is not a character string or even a character. It's a series of flags.

If you want to display the character, that's wParam. But, remember, it's a single character and not a null-terminated string.

You can try:
   case WM_CHAR:      mesgg[0]=wParam;      mesgg[1]=0;


Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

This topic is closed to new replies.

Advertisement