I want to use activex event in javascript.
Here is my htm:
<HTML>
<HEAD>
<TITLE>Scriptable ActiveX Web Control</TITLE>
</HEAD>
<BODY>
<script for=ATLEvent event=ExecutionOver(result) language="Javascript">
alert(result);
</script>
<OBJECT ID="ATLEvent" CLASSID="CLSID:5B898DEC-8172-4B6D-BF1C-FCEF7B517090">
</OBJECT>
</BODY>
</HTML>
<SCRIPT LANGUAGE="JavaScript">
ATLEvent.Add(1, 2);
</SCRIPT>
The activex is simple. It's an atl com dll project. It has an interface
named IXMath and an implemented connect point. The activex project was
downloaded from http://www.codeproject.com/KB/atl/ConnectionPoint.aspx .
I have searched many internet titles. I can't find what's the mistake.
Please let me know where is the mistake.
Thanks in advanced.
So, what exactly is the problem? You never actually mentioned that. On a
hunch, see if this helps:
http://support.microsoft.com/kb/200839
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
But now I have another problem. I want to create a thread in activex, and
fire the event in the thread just before thread exit. The activex can't fire
the event.
Here is my thread code:
CThreadParam* threadParam = (CThreadParam*)pParam;
auto_ptr<CThreadParam> paramPtr(threadParam);
HRESULT hr =
threadParam->pThis->HttpDownFile(threadParam->m_strRemote.c_str(),
threadParam->m_strLocal.c_str());
threadParam->pThis->Fire_DownloadComplete(hr,
threadParam->pThis->m_bstrInfo, threadParam->pThis->m_bstrDesc);
threadParam->pThis is the pointer of Component class.
Does it matter with thead model?
"Igor Tandetnik" <itand...@mvps.org> д����Ϣ����:%236nYQ4%> So, what
Have the thread post a custom message to the control's window, and fire
the event from that message's handler. You can't easily fire events
directly from the worker thread.