Are you compiling a project on windows with a function named ‘SendMessage’ and wondering why you are receiving an C2039 error regarding ‘SendMessageA’ is not a member of? This is an issue specific to windows, as windows has a built in SendMessageA function that is aliased as SendMessage.
To fix the issue, simply rename the function (i.e SendClientMessage) not to clash with the existing SendMessage in windows. Alternatively at the top of your source file with the error, you can ‘#define SendMessageA SendMessage’ to keep the preprocessor from rewriting the send message function. This problem is reproducible anytime you link against windows such as kernel32.dll due to including “windows.h”
With this solution, your ‘SendMessageA’ is not a member of error will stop appearing.
Was this blog helpful? Check out our top work from home essentials to stay comfortable and productive while you work:
|HD Webcam||Noise Cancelling Headphones||HD Monitor||Ergonomic Keyboard and Mouse||Standing Desk|