OK folks, got somewhere at least. This is my new code:
__gc class AppFunctionClassThing{public: static void MyAppMainFunction() { Application::Run(new Form1()); }};int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow){ System::Threading::Thread::CurrentThread->ApartmentState = System::Threading::ApartmentState::STA; System::Threading::ThreadStart* ts = new System::Threading::ThreadStart(0, &AppFunctionClassThing::MyAppMainFunction); System::Threading::Thread* myappthread = new System::Threading::Thread(ts); myappthread->ApartmentState = System::Threading::ApartmentState::STA; myappthread->Start(); myappthread->Join(); return 0;}
This fixes the original problem but I still get an error:
Quote:An unhandled exception of type 'System.IO.FileNotFoundException' occurred in system.windows.forms.dll
Additional information: File or assembly name Interop.SHDocVw, or one of its dependencies, was not found.
When it tries to do this:
this->ResumeLayout(false);
I've got AxInterop.Shdocvw.dll in my working directory, perhaps the Ax in the filename is the problem or something strange. I'm willing to bet it's something stupid, but I'll muck around with it in the morning *yawn* Late night debugging != fun.
Thanks for the help chaps, AR