Re: Porting CDialog to ActiveX



First, start with an ActiveVirus, I mean ActiveX, pattern and go from there. See below.

Note that putting ActiveVirus controls on Web pages is sociopathic, and many sites will
block the execution of unsigned ActiveVirus controls, and other, more extreme sites, block
all forms of client-side scripting because they are largely Realy Bad Ideas from a
security viewpoint.
joe

On Wed, 11 Jul 2007 17:25:45 GMT, SpacemanSpiff <Spaceman@xxxxxxxxxxxxxxxxxx> wrote:

Before you tell me it's a bad idea, it wasn't mine. You all
know how executives are...

We have an app that is MFC CDialog based. There is nothing overly
complex, or excessive MFC entrenched in it. There is a socket
thread that does communication and heartbeats. It sends data to
the CDialog with "ON_MESSAGE" maps.
They want to convert it to run "on the web". My take is to
convert it to an ActiveX and embed it in IE. All the
ini/registry settings would now be passed down as
<OBJECT ... PARAM NAME= VALUE= > tags

I've got it all working as MFC ActiveX Wizard project, except #5
below. So I'm trying to do it as a ATL project. Hopefully,
that'll solve the problem.

So I'm seeking what should be simple questions:

I have written literally *tons* of raw Win32 (Petzold) windows
programs. I also use MFC quiet a bit. But ActiveX is a little
foreign to me.
****
It is to me, also, and I once taught a course about how to do it. I decided that it was
essentially gratuitously complex, and I had better ways to spend my time.
****

I've tried the "Composite Control, figuring I can add my dialog
controls there. Hmmm...

1. Is there a way to just drop the CDialog into a "Composite
Control", or something similar? There are some subclassed MFC
CEdits that I need to keep. And I can't see how to attach them into
the Composite Control, as it's not CWnd based. Of course I can't
use the MFC macros to do it.
****
I think all you need to do is make it a child style (rather than a popup) and I think that
would work. That's just a guess.
****

2. Where is the best place to launch the thread? In the OnInitDialog?
Then clean it up in the OnDestroy?
****
Sounds reasonable.
****

3. How do I set the background color?? It's all based on a dialog
resource template, and the controls from the template appear, but
it's not using the background color..? In Win32 I use the WNDCLASS
registration, in MFC I override the virtual PreCreate.
In this case, I can't find any place that exposes it for me.
*****
There is an ActiveX property called "ambient background" or something similar, which is
probably what should be used. You would handle this on OnEraseBkgnd for the dialog class.
Don't forget to use WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles.
****

4. How do I get the parameters from the Web page that embedded it?
In a simple "MFC ActiveX Control" app, there is the macro
"PX_String(pPX,_T("SERVER"),m_server); "
Is there anything in the ATL project to does it so simply?
****
This is one I can't answer or even guess at.
****

5. I got everything working as a "MFC ActiveX Control", except the
*arrows keys don't work in the edit controls* (!!). They do in the
ATL app, so I'm trying to use that as my template. I can't
figure out what's wrong the MFC ActiveX one.

5. The ATL library/Wizards placed all this stuff in the header
file(!!) That really makes it 'unusual' to deal with (unless
you an old java kinda guy...:-) Do I have to keep it there, not
use a *.cpp file?
****
All what stuff?
****

Any advice is appreciated!
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: MFC 7.1 als Container für .NET Controls
    ... > mittels der von regasm erzeugten Typbliothek innerhalb der MFC ... DU MUSST FÜR EIN .NET-CONTROL, ... > gemacht wurden) als ActiveX zu hosten, ... > tatsächlich möglich NET Controls als ActiveX in allen möglichen ...
    (microsoft.public.de.vc)
  • Re: Deep Throat
    ... this port by default: ... >>Norton Firewall, can you block inbound traffic and allow ... >>Your browser will be checked for installed ActiveX ... >>ActiveX controls are a kind of enhancement plugins for ...
    (microsoft.public.security.virus)
  • Re: Finally finished SBS Install, not a config question...
    ... What's the error message can you see when you visit the Windows Update ... Automatic prompting for Active X controls Disable ... Initialize and script ActiveX controls not marked as safe Disable ...
    (microsoft.public.windows.server.sbs)
  • Re: Deep Throat
    ... Norton Firewall 2004, but are so annoying that they keep ... >Port 1025 will have to be open to out bound traffic, ... >Your browser will be checked for installed ActiveX ... Invocation of secure ActiveX controls ...
    (microsoft.public.security.virus)
  • Re: How to create a form in Word documents to contain checkboxes e
    ... you've reached the limits of my ignorance when it comes to ActiveX ... Other than those that come with the vba editor, ... This message is posted to a newsgroup. ... the activeX controls such checkboxes, textboxes etc. in the toolbox and ...
    (microsoft.public.word.vba.userforms)

Loading