View Single Post

  #1 (permalink)  
Old 11-23-2006
ANDYL ANDYL is offline
Junior Member
White Belt
 
Join Date: Oct 2006
Posts: 4
Angry VS2005 upgrade of VB app with MP control fails with GPF "ActiveX Ctrl...not in a STA"

After converting a VS2003 VB Winform control to VS2005 which has a MapPoint control embedded in it I am now getting runtime exception

"ActiveX control '8f78d7fc-bae4-46a4-a79a-052356ab3dd4' cannot be instantiated because the current thread is not in a single-threaded apartment.".

My app contains a Windows.Forms.UserControl class with MapPoint control embedded on it and a test form I use to develop and debug the UserControl. I tried tagging the Sub Main with <STA...> attribute as per MSDN article with no success.

When I embed the usercontrol in my ASPX page it just crashes the page.

This usercontrol is intended to be accessed embedded in an ASP.NET page via IE7.

I'm stuck.
Reply With Quote