Re: MFC ActiveX newb needs a little help (Crossposted from ms.public.vc.mfcole)



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



.



Relevant Pages

  • MFC ActiveX newb needs a little help (Crossposted from ms.public.vc.mfcole)
    ... never coded an activeX control before, nor worked extensively with MFC ... hosted HTML interface and a stand-alone .exe running in the background. ... ActiveX newb working with control-to-exe communication or just activex ...
    (microsoft.public.vc.mfc)
  • Re: Keyboard handling in exe based servers
    ... CAtlExeModuleT cannot possibly know of any modeless dialog your ... Then every dialog needs to register itself with the module when ... There ain't no such thing as an ActiveX control implemented in an EXE. ...
    (microsoft.public.vc.atl)
  • Cant follows links to .zip or .exe files
    ... I recently removed the nkvd.us adware from my system ... (after becoming infected following a wayward click to ... allow an ActiveX control), and now have my homepage, ... Right-clicking a .exe or .zip link then choosing 'Open' ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Convert EXE to ActiveX Control
    ... I have developed a .exe VoiceChat software that uses winsock to communicate ... I used VB6 ... way that came to mind is to convert this .exe into an ActiveX Control so that ... Any advices on how I can covert my Standard EXE project into an ActiveX ...
    (microsoft.public.dotnet.framework)
  • (HELPLESS CASE) How dynamically add Controls from other-not referenced project!?
    ... Where in EXE I don't use reference to OCX, cause I need to read different controls, depending on some other value. ... Public Sub Form_Unload ... I need to provide compiled EXE project that can load Control from VB Project ...
    (microsoft.public.vb.com)

Loading