Re: Porting CDialog to ActiveX
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Wed, 11 Jul 2007 16:34:22 -0400
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?
****
Joseph M. Newcomer [MVP]
Any advice is appreciated!
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: Porting CDialog to ActiveX
- From: SpacemanSpiff
- Re: Porting CDialog to ActiveX
- Prev by Date: Re: Manifests and requestedExecutionLevel
- Next by Date: Re: cannot open file 'mfc42.lib' in Visual Studio 2005
- Previous by thread: BitBlt Bitmap to Region ???
- Next by thread: Re: Porting CDialog to ActiveX
- Index(es):
Relevant Pages
|
Loading