Weird outputs from SendMessage on 64-bit Windows

I'm sort of new to Windows GUI programming. I got some code which works fine on 32-bit Windows but go weird on 64-bit Win7 (same exe).

LWG_CEDIT_GET( m_hwnd, IDC_EDIT_NUM_TEST, g_tmp_str, 4096 );

where LWG_CEDIT_GET is defined as:

#define LWG_CEDIT_GET(h,id,v,m) \
((*((U32*)(v))=(m)),SendMessage(GetDlgItem((h),(id)),EM_GETLINE,0,(LPARAM)(char*)(v))

On WinXP 32, this gives me g_tmp_str="1" (of course I inputted '1' into the textfield in dialog). But, on Win7 64, this gives me g_tmp_str=""(Oops, the weird character can't be shown in stackoverflow, whatever, odd char. [0]=49'1' [1]=16'').

Generally speaking, 32bit exe program can work flawlessly on Win7 64, so, why my program failed? Thanks.

Edit 1: IsWindowsUnicode(m_hwnd) returns FALSE.

Answers


See my last comments of the topic.


Need Your Help

Inside a batch file, how can I tell whether a process is running?

windows batch-file process

I'd like to write a batch file that checks to see if a process is running, and takes one action if it is, and another action if it isn't.

Telerik, Updating RadListControl items issue

c# .net vb.net winforms telerik

( First of all I need to clarify that I could manage both C# or VB solution to solve this issue )

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.