Re: Send messages from Web-browser to MFC-application?
"Gaute" <Gaute@nospam.nospam> wrote in message
This might be wrong news-group, maybe somebody can help me with that too.
I want my MFC-application to receive messages (DDE, Automation,
WM_COPYDATA or whatever is not too hard to receive) from a hyperlink or
button on a web-page. The MFC application and the Web browser are running
on the same computer. This must work on IE7/IE8 but a universal solution
Is it possible to send messages to my MFC-application from an html-page
running in my web-browser? How?
Not without an ActiveX control in the html page. Or perhaps you could use
appropriate message (either way, you need an ActiveX object). I'm not sure
if there is a pre-existing ActiveX object like WMI or something that you can
use or if you need to build one yourself. Anyway, since ActiveX objects are
so easily disabled by the user, it is not a very good way... and ActiveX is
plain disgusting to program, IMHO.
However, if you use a MFC CDHTMLDialog, you can show the html page in that,
and your MFC code can receive events like links in the html page being
clicked. Then since your MFC code is C++, you can easily post the desired
message to whatever window you want.