سلام
اگه لطف کنین سریع جواب بدین ممنون می شم
من تو VC++‎.net برنامه نویسی می کنم
می خوام یه OpenFileDialog باز کنم با استفاده از .net frameworks کد زیر رو می نویسم


OpenFileDialog ^MyDialog = gcnew OpenFileDialog;
MyDialog->ShowDialog();



ولی به خط دومی ایراد زیر رو می گیره ، error نمیده ولی برنامه رو وقتی میرسه به این خط قطع می کنه و پیغام زیر رو می ده می تونین کمممکم کنین؟

A first chance exception of type 'System.Threading.ThreadStateException' occurred in System.Windows.Forms.dll
An unhandled exception of type 'System.Threading.ThreadStateException' occurred in System.Windows.Forms.dll

Additional information: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process.