VBGuyUsingVC
Programmer
Hi,
I'm not certain what needs to be done here. I want my activeX control to fire an event. Here's a sample:
//my app will call this function first (DoWatch) and then
//wait on events to fire
BOOL CAxCtrl:oWatch(LPCTSTR strToWatch, long dwChangesToWatch, BOOL bWatchSub)
{
// TODO: Add your dispatch handler code here
dc.StartWatch((CString)strDirToWatch, (DWORD)dwChangesToWatch, &dch,bWatchSub);
return TRUE;
}
//a thread created by dc.StartWatch calls this
//function when certain condition arise:
void mWatchHandler::On_DataIn(const CString &strName)
{
CAxCtrl *RaiseEvent = new CAxCtrl;
RaiseEvent->TriggerEvent_DataIn(strName);
delete RaiseEvent;
}
CAxCtrl::TriggerEvent_DataIn(LPCTSTR strName)
{
FireDataIn(strName); //function is called but event is not triggered is app (????)
}
I'm not certain what needs to be done here. I want my activeX control to fire an event. Here's a sample:
//my app will call this function first (DoWatch) and then
//wait on events to fire
BOOL CAxCtrl:oWatch(LPCTSTR strToWatch, long dwChangesToWatch, BOOL bWatchSub)
{
// TODO: Add your dispatch handler code here
dc.StartWatch((CString)strDirToWatch, (DWORD)dwChangesToWatch, &dch,bWatchSub);
return TRUE;
}
//a thread created by dc.StartWatch calls this
//function when certain condition arise:
void mWatchHandler::On_DataIn(const CString &strName)
{
CAxCtrl *RaiseEvent = new CAxCtrl;
RaiseEvent->TriggerEvent_DataIn(strName);
delete RaiseEvent;
}
CAxCtrl::TriggerEvent_DataIn(LPCTSTR strName)
{
FireDataIn(strName); //function is called but event is not triggered is app (????)
}