I'm trying to use the console template.
Thanks
> >I generated the project using Application Wizard.
> > thanks
[quoted text clipped - 29 lines]
> >>
> What C++ project template are you using?
> I'm trying to use the console template.
>
> Thanks
OK, I've copied the code in your original post into a Console Application
shell here, and it compiles without error and runs correctly. That
exonerates the code. How long have you had Visual Studio installed (And,
please say which version you have. I use Visual Studio .NET 2003), and have
you tried any other project/template types to see if they work (a simple VB
Windows app, for instance)?
Right now, it looks as if there is something wrong with your installation,
and with only the symptoms reported to go on, I'd suggest a repair install
of Visual Studio.

Signature
Peter [MVP Visual Developer]
Jack of all trades, master of none.