Re: MFC ActiveX newb needs a little help (Crossposted from ms.public.vc.mfcole)
- From: "Paul Barrett" <pwbarrett@xxxxxxxxxxxxxxxxx>
- Date: Tue, 21 Mar 2006 12:09:29 -0600
1. At that point it's just like any other case of needing inter-process
communication. Is the EXE something that you have the source to and can
modify? If so I'd probably add a COM interface to the EXE (or maybe it
already has one), then call methods on that from your new OCX. If you don't
want to use COM, there's named-pipes, sockets, etc. but that's all more
work.
If the EXE is something that you can't modify, like media-player for
example, your OCX could find the EXE's window using FindWindow, then post it
messages to simulate keys or something.
2. No the CLSID won't change. It was generated once by the wizard and is
permanent unless you manually edit it in the .IDL file.
Maybe others have suggestions for 3 and 4.
<the.tarquin@xxxxxxxxx> wrote in message
news:1142921366.493107.288530@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi everyone,
I was referred to this newsgroup after much searching elsewhere, so
I'm hoping this is the right kind of place for my questions. I've
never coded an activeX control before, nor worked extensively with MFC
(though I am quite proficient with C++, so I'm not finding MFC to be
much of a problem) and now I've found myself involved in a project
which requires me to code an activeX control to communicate between a
hosted HTML interface and a stand-alone .exe running in the background.
I'm starting to believe I may be in a touch over my head. Some
specific questions I have: (For reference, the application in question
is a distributed audio app designed for home automation.)
1.) If I have an activeX control which is going to compile down to
an .ocx, how would I go about establishing communication between it and
an .exe? The .ocx needs to be able to access functions in the .exe so
that it can, for example, send play, pause, and stop commands from the
html interface through to the stand-alone .exe.
2.) I've managed (after some struggle) to retrieve the clsid that
my activeX control is registering so that I can use it in an object
tag. Will this ever change? If I dump my control on another box, it
will always register the same clsid? How about if I make code changes
and recompile?
3.) While I'm starting to understand a little more about this whole
activeX thing, any good sources for beginners that you could send links
for would be most appreciated.
4.) The flighty, random question: Anyone have any advice for an
ActiveX newb working with control-to-exe communication or just activex
in general? Anything that you wish you'd known when you were just
trying to puzzle this whole thing out?
I've plowed through one small book on ActiveX in MFC, but it was
impressively unhelpful. Any help that the friendly members of the
intarweb can provide would be much appreciated.
Cheers,
Aaron Brown
.
- References:
- MFC ActiveX newb needs a little help (Crossposted from ms.public.vc.mfcole)
- From: the . tarquin
- MFC ActiveX newb needs a little help (Crossposted from ms.public.vc.mfcole)
- Prev by Date: CSocket, DLL and OnReceive never being called
- Next by Date: Re: CTreeCtrl insert 150 000 items
- Previous by thread: MFC ActiveX newb needs a little help (Crossposted from ms.public.vc.mfcole)
- Next by thread: Unhandled exception in app1.exe(WNRPC32.DLL): 0xC0000005: Access Violation.
- Index(es):
Relevant Pages
|
Loading