Single thread application with MC++

S

Simon

Hi, I need set a single thread an application developed mc++ vs2003 to
create an activex into a form, so I try to set the ApartmentState property
on _tWinMain method
but this doesn't work the ApartmentState is always set to MTA.


[System::STAThreadAttribute]
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR
lpCmdLine, int nCmdShow)
{
System::Threading::Thread::CurrentThread->ApartmentState =
System::Threading::ApartmentState::STA;
......
}


How do I to set correcty the ApartmentState to STA ?

Thanks

Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top