A
Airw0lf
Hi all, would appreciate help with some trouble I'm having after using the
Visual C++ 2005 Express Conversion Wizard on my Visual C++ .NET 2003
project.
The wizard completed successfully with only warnings about using a "fully
qualified name with the use of the address-of operator (e.g.
&ClassName::MemberFunctionName)". I added the & operator as needed and
eliminated the compile errors relating to those warnings.
The problem I am facing now is in the .cpp file associated with my form
(MainForm.cpp). The MainForm.cpp in 2003 .NET contained a '#include
<windows.h>' line, which will not compile, since windows.h does not seem to
come with Visual C++ 2005 Express.
If I comment out the windows.h include, the compilation fails at the
entrypoint function in MainForm.cpp:
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
System::Threading::Thread::CurrentThread->ApartmentState =
System::Threading::ApartmentState::STA;
Application::Run(new MainForm());
return 0;
}
I presume that a lot of the structures defined in the function arguments
above depend on windows.h.
I can of course comment out the entrypoint function, which allows the
compiler to successfully terminate. But as expected, the linker will fail
as it cannot find an entrypoint:
Error 1 error LNK2019: unresolved external symbol _WinMain@16 referenced
in function ___tmainCRTStartup MSVCRT.lib
I am sure this is a fairly common problem, but I am stuck!
Visual C++ 2005 Express Conversion Wizard on my Visual C++ .NET 2003
project.
The wizard completed successfully with only warnings about using a "fully
qualified name with the use of the address-of operator (e.g.
&ClassName::MemberFunctionName)". I added the & operator as needed and
eliminated the compile errors relating to those warnings.
The problem I am facing now is in the .cpp file associated with my form
(MainForm.cpp). The MainForm.cpp in 2003 .NET contained a '#include
<windows.h>' line, which will not compile, since windows.h does not seem to
come with Visual C++ 2005 Express.
If I comment out the windows.h include, the compilation fails at the
entrypoint function in MainForm.cpp:
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
System::Threading::Thread::CurrentThread->ApartmentState =
System::Threading::ApartmentState::STA;
Application::Run(new MainForm());
return 0;
}
I presume that a lot of the structures defined in the function arguments
above depend on windows.h.
I can of course comment out the entrypoint function, which allows the
compiler to successfully terminate. But as expected, the linker will fail
as it cannot find an entrypoint:
Error 1 error LNK2019: unresolved external symbol _WinMain@16 referenced
in function ___tmainCRTStartup MSVCRT.lib
I am sure this is a fairly common problem, but I am stuck!