Hi all,
i have developed a class that has a member called 'PostMessage'
if i only reference this member from within the class context, there is no
problem, but if i trie to execute it as a method, i get the error
error LNK2019: unresolved external symbol "public: void __thiscall
MessageQ::PostMessageA(struct t_Message *)"
(?PostMessageA@MessageQ@@QAEXPAUt_Message@@@Z) referenced in function
"public: void __thiscall Dispatcher::SendMessageA(struct t_Message *)"
(?SendMessageA@Dispatcher@@QAEXPAUt_Message@@@Z)
The offending code is:
msgQ->PostMessage(Message);
where msgQ is an instance of my own class MessageQ, and the method exists
with the correct prototype.
can anybody please tell me how to solve this problem?
thanks,
Bruno.
Fredrik Wahlgren - 25 Mar 2005 18:44 GMT
> Hi all,
>
[quoted text clipped - 20 lines]
>
> Bruno.
There is an API function with the same name. What happens if you rename it?
/Fredrik
Bruno van Dooren - 25 Mar 2005 22:12 GMT
>> Hi all,
>>
[quoted text clipped - 26 lines]
>
> /Fredrik
thanks for your reply.
my functions linked fine if i renamed them.
as Carl said in his answer, those functions are defined as macros. as a
result, my function names got replaced by the windows function names.
Bruno.
Carl Daniel [VC++ MVP] - 25 Mar 2005 19:10 GMT
> Hi all,
>
[quoted text clipped - 3 lines]
> is no problem, but if i trie to execute it as a method, i get the
> error
#undef PostMessage - it's a macro defined by windows.h (either PostMessageA
or PostMessageW depending on _UNICODE).
-cd
Bruno van Dooren - 25 Mar 2005 22:10 GMT
Ok that makes sense.
that also explains why it worked within the class definition: i didn't
include windows.h there.
thanks all.
Bruno.
>> Hi all,
>>
[quoted text clipped - 8 lines]
>
> -cd