3,245
社区成员
发帖
与我相关
我的任务
分享
<OBJECT ID="ocx" style="LEFT: 0px; TOP: 0px;" width="100%" height="100%"
CLASSID="CLSID:87920FCC-D541-4C57-B42A-712421A7F27D"
codebase="C:\WINDOWS\system32\VMC_OCX.ocx">
<PARAM NAME = "StartScreen" VALUE = "history">
</OBJECT>
int CVMC_OCXCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (COleControl::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
if(m_StartScreen == "")
{
//AfxMessageBox("NULL");
m_VMCDlg.Create(IDD_MAINDLG,this);
m_VMCDlg.ShowWindow(SW_SHOW);
}
else if (m_StartScreen == "patrol")//如果html中指定属性值为patrol 则加载此对话框
{
//AfxMessageBox("patrol");
m_VMCDlg.Create(IDD_MAINDLG,this);
m_VMCDlg.ShowWindow(SW_SHOW);
}
else if(m_StartScreen == "history")//如果html中指定属性值为history则加载此对话框
{
//AfxMessageBox("history");
m_ViewuserDlg.Create(IDD_US_USER,this);
m_ViewuserDlg.ShowWindow(SW_SHOW);
}
return 0;
}
void CVMC_OCXCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
if (!pdc)
return;
// TODO: Replace the following code with your own drawing code.
if(m_StartScreen == "")
{
m_VMCDlg.MoveWindow(rcBounds,TRUE);
}
else if (m_StartScreen == "patrol")
{
m_VMCDlg.MoveWindow(rcBounds,TRUE);
}
else if(m_StartScreen == "history")
{
m_ViewuserDlg.MoveWindow(rcBounds,TRUE);
}
}
void CVMC_OCXCtrl::DoPropExchange(CPropExchange* pPX)
{
ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
COleControl::DoPropExchange(pPX);
if (pPX->GetVersion() == (DWORD)MAKELONG(_wVerMinor, _wVerMajor))
{
PX_String(pPX,_T("StartScreen"),m_StartScreen);
}
// TODO: Call PX_ functions for each persistent custom property.
}
<OBJECT ID="ocx" style="LEFT: 0px; TOP: 0px;" width="100%" height="100%" CLASSID="CLSID:87920FCC-D541-4C57-B42A-712421A7F27D"
codebase="C:\WINDOWS\system32\VMC_OCX.ocx">
<PARAM NAME = "mystarttype" VALUE = "history">
</OBJECT>