int CDuiActiveX::OnCreate( LPVOID ) { if(IsEqualCLSID(m_clsid,CLSID_NULL)) return 0; if(!m_bDelayInit) InitActiveX(); return 0; }
void SActiveX::OnShowWindow( BOOL bShow, UINT nStatus ) { __super::OnShowWindow(bShow, nStatus); if(IsVisible(TRUE) && m_bDelayInit) { InitActiveX();//窗口显示时才初始化 m_bDelayInit=FALSE; } SetActiveXVisible(IsVisible(TRUE)); }
void CDuiActiveX::OnShowWindow( BOOL bShow, UINT nStatus ) { __super::OnShowWindow(bShow, nStatus); if(bShow && m_bDelayInit) { InitActiveX();//窗口显示时才初始化 m_bDelayInit=FALSE; } SetActiveXVisible(bShow); }
void VApplication::Init( HINSTANCE hInstance, VINT nCommandShow) #endif { VASSERT(hInstance) /* Global application object should be uninitialized, you are walking on it!*/ VASSERT(m_hInstance == NULL) m_hInstance = hInstance; /* If resource handle was not previously set, set to same as application.*/ if ( !m_hResource ) m_hResource = hInstance; /* Initialize Component Object Model (as needed).*/ InitActiveX(VTRUE); /* Save show value.*/ m_nCommandShow = nCommandShow; #ifndef VWCL_DONT_REGISTER_CLASSES /* Register VWindow class.*/ WNDCLASS wc; /* Use default window class struct?*/ if ( !pWindowClass ) { VZEROSTRUCT(wc); pWindowClass = &wc; /* Initialize defaults.*/ pWindowClass->style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; /* We allow some basic customizations here, icon and background brush.*/ pWindowClass->hbrBackground = hBackgroundBrush; if ( nIconID ) { pWindowClass->hIcon = LoadIcon( VGetInstanceHandle(), MAKEINTRESOURCE(nIconID)); VASSERT(pWindowClass->hIcon) } else