Re: error C2065: 'AfxMessageBox' : undeclared identifier



sorry, it is my mistake. please see the following code snippet, it can be
compiled with VC++ 6.0

#define _MT
//#include <afx.h>
#include <afxwin.h>
void main()
{
AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0);
AfxMessageBox("www.fruitfruit.com");
}




"MarkS" <MarkS@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6B0B8B5D-BDA4-4F13-ABF2-41B9AAE01ED8@xxxxxxxxxxxxxxxx
> Thanks you for your help but I'm still encountering the error.
>
> I have included the following in my header class
>
> #include <afx.h>
> #include <afxcoll.h>
>
> But it still shows:
> error C2065: 'AfxMessageBox' : undeclared identifier
>
> When I compile
>
> Thanks in advance
>
>
>
> "www.fruitfruit.com" wrote:
>
>> #include <afx.h>
>>
>>
>> "MarkS" <MarkS@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:7B23EF58-4E38-4AB9-8240-270FACFEC672@xxxxxxxxxxxxxxxx
>> > Hello,
>> >
>> > I am trying to use the AfxMessageBox function within my C++ Program but
>> > am
>> > coming across the above error.
>> >
>> > I have included afxcoll.h but should there be another header that needs
>> > to
>> > be included or could someone point me in the right direction.
>> >
>> > Thanks in advance
>>
>>
>>


.



Relevant Pages

  • Re: Explain this
    ... > Here is a short code snippet which does not compile. ... > void set(int a, int b) ...
    (comp.lang.cpp)
  • Re: Explain this
    ... > Here is a short code snippet which does not compile. ... > void set(int a, int b) ...
    (comp.lang.cpp)
  • Re: Explain this
    ... >Here is a short code snippet which does not compile. ... > void set(int a, int b) ...
    (comp.lang.cpp)
  • Explain this
    ... Here is a short code snippet which does not compile. ... void set(int a, int b) ...
    (comp.lang.cpp)
  • Re: menu-based console application
    ... typedef void; ... struct MenuEntry ... Compile everything, fix typing errors and run the program. ...
    (alt.comp.lang.learn.c-cpp)