Hey everyone, I am modifying code upgraded from VB 6 to 2005. I need to run the 2005 code in the MTA mode so I set a sub main procedure in my module which runs first when the program starts:
Public theApplicationForm As New Form1
<MTAThread()> Public Sub main()
Application.Run(theApplicationForm)
End Sub
However, when this launches the Form1, I receive the following runtime error:
{"ActiveX control 6262d3a0-531b-11cf-91f6-c2863c385e30 cannot be instantiated because the current thread is not in a single-threaded apartment."}
I dont know how to proceed from here. I realize that the ActiveX component is something old VB6 code still being used..I believe it is an MSFlexGrid. How do I run my program as multithreaded successfully? MANY THANKS!!
Public theApplicationForm As New Form1
<MTAThread()> Public Sub main()
Application.Run(theApplicationForm)
End Sub
However, when this launches the Form1, I receive the following runtime error:
{"ActiveX control 6262d3a0-531b-11cf-91f6-c2863c385e30 cannot be instantiated because the current thread is not in a single-threaded apartment."}
I dont know how to proceed from here. I realize that the ActiveX component is something old VB6 code still being used..I believe it is an MSFlexGrid. How do I run my program as multithreaded successfully? MANY THANKS!!