Главная страница | назад





Article #16258: SendMessage() in C++Builder

 Question and Answer Database

FAQ1258C.txt   SendMessage() in C++Builder
Category   :Windows API
Platform    :All
Product    :C++Builder  1.x

Question:

I'm writing code to create an object with a member function 
called SendMessage, but i'm getting wierd linker errors.
What is going on?

Answer:

If you investigate win32/winuser.h, you will see the following:

#ifdef UNICODE
#define SendMessage SendMessageW
#else
#define SendMessage SendMessageA
#endif

which causes calls to your method to get changed
to something else.

You probably need to include a header which does this

(a) #undef SendMessage
(b) provides function wrappers which convert the WINAPI
SendMessage(HWND, UINT, WPARAM, LPARAM) to either
SendMessageW or SendMessageA, depending on whether or not
UNICODE is defined.

7/2/98 10:32:32 AM
 

Last Modified: 01-SEP-99