T
Tom Archer
I'm writing mixed-mode (MC++ and MFC) applications. Under
certain circumstances - such as when using the BCL
Clipboard class - the application excepts. I've tracked
this down to understanding that I need to define my
application's main thread as STA. Therefore I've done the
following:
1) Set up a custom manage entry point: /ENTRY:MyMain
2) Put [System::STAThread] attribute on the new entry point
3) Call WinMainCRTStartup() to run the normal CRT entry
point.
(Here's the code from my stdafx.h file)
extern "C" void WinMainCRTStartup();
#using <System.dll>
[System::STAThread]
void MyMain()
{
WinMainCRTStartup();
}
However, when I do this I receive numerous linker warnings
about functions such as __amsg_exit already being defined.
Finally, I get an "unresolved external error"
_mainCRTStartup.
certain circumstances - such as when using the BCL
Clipboard class - the application excepts. I've tracked
this down to understanding that I need to define my
application's main thread as STA. Therefore I've done the
following:
1) Set up a custom manage entry point: /ENTRY:MyMain
2) Put [System::STAThread] attribute on the new entry point
3) Call WinMainCRTStartup() to run the normal CRT entry
point.
(Here's the code from my stdafx.h file)
extern "C" void WinMainCRTStartup();
#using <System.dll>
[System::STAThread]
void MyMain()
{
WinMainCRTStartup();
}
However, when I do this I receive numerous linker warnings
about functions such as __amsg_exit already being defined.
Finally, I get an "unresolved external error"
_mainCRTStartup.