是这样的我制作了一个activex控件,控件是这样做的,在create事件里面我产生了9个static,然后显示,可是在加到vb工程里面的时候呢,不运行他就不会出现这几个创建的static,运行以后才能出现,请问我该在哪个事件里面创建这几个static并且显示,才能在调试的时候也能出现这几个static谢谢

解决方案 »

  1.   

    In MFC there is COleControl::AmbientUserMode(). In ATL there is CComControl::GetAmbientUserMode(). You can also implement IOleControl::OnAmbientPropertyChange and watch for DISPID_AMBIENT_USERMODE property.After IOleObject::SetClientSite is called, Ambient properties can be queried off of from the client site pointer. You can override the IOleObject::SetClientSite implementation(COleControl::OnSetClientSite/CComControl::SetClientSite) , forward the call to the inherited implementation, then access ambient properties. 
    Reference
    support.microsoft.com/kb/195188