ActiveX


MyCtrl.cpp - 2


}

 

CString CMyCtrl::GetCaption()

{

CString result;

GetProperty(DISPID_CAPTION, VT_BSTR, (void*)&result);

return result;

}

 

void CMyCtrl::SetCaption(LPCTSTR propVal)

{

SetProperty(DISPID_CAPTION, VT_BSTR, propVal);

}

 

COleFont CMyCtrl::GetFont()

{

LPDISPATCH pDispatch;

GetProperty(DISPID_FONT, VT_DISPATCH, (void*)&pDispatch);

return COleFont(pDispatch);

}

 

void CMyCtrl::SetFont(LPDISPATCH propVal)

{

SetProperty(DISPID_FONT, VT_DISPATCH, propVal);

}

 

unsigned long CMyCtrl::GetTextColor()

{

unsigned long result;

GetProperty(0x4, VT_I4, (void*)&result);

return result;

}

 

void CMyCtrl::SetTextColor(unsigned long propVal)

{

SetProperty(0x4, VT_I4, propVal);

}

 

long CMyCtrl::GetSleep()

{

long result;

GetProperty(0x5, VT_I4, (void*)&result);

return result;

}

 

void CMyCtrl::SetSleep(long propVal)

{

SetProperty(0x5, VT_I4, propVal);

}

 

/////////////////////////////////////////////////////////////////////////////

// CMyCtrl operations

 

void CMyCtrl::DoClick()

{

InvokeHelper(DISPID_DOCLICK, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);

}

 

BOOL CMyCtrl::DoChangeTimer()

{

BOOL result;

InvokeHelper(0x6, DISPATCH_METHOD, VT_BOOL, (void*)&result, NULL);

return result;

}

 

void CMyCtrl::AboutBox()

{

InvokeHelper(0xfffffdd8, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);

}

 





- -  - -  - -