C# - ActiveX control without a form

参考 http://stackoverflow.com/questions/1531512/c-sharp-activex-control-without-a-form

Thread thread = new Thread((ThreadStart) 
delegate 
{ 
_myActiveX = new MyActiveXType(); 
_myActiveX.CreateControl(); 
 
//more initialize work 
 
Application.Run(); 
}); 
thread.SetApartmentState(ApartmentState.STA); 
thread.IsBackground = true; 
thread.Start(); 
          
  while (true)
            {
                if (_axgw != null)
                {
                     //_myActiveX.Method;
                }
            }

  


posted on 2012-03-08 16:20  枫江白露  阅读(234)  评论(0编辑  收藏  举报

导航