I have a MFC (MDI) application, say B.exe, which has no COM support
yet.
Now a I have to write a new app A.exe (which will be MFC as well),
which must be able to open a document of B.exe in it's own surface.
Just as a PDF document is shown within InternetExplorer and not
opened in Adobe Reader.
I think COM will be the right thing to do so. A.exe would be the
client
and B.exe the server. Next thing is that not only B.exe has to be
automated, but a whole bunch of EXEs, some of which written with MFC,
others written in Delphi.
With no idea of the details of COM I started reading about it and
find a lot of different approaches. Can someone please recommend me
where to start? I am looking for some article suiting my situation
or for some example which solves a similar task.
TIA
---
Ajay
"Uwe Kotyczka" <uwe.ko...@web.de> wrote in message
news:0ac96a20-c6fb-4aba...@m36g2000hse.googlegroups.com...
Uwe Kotyczka schreef:
COM is not always needed. For example a webbrowser that can both
display HTML and PDF files can be achieved with plain object oriented
programming techniques.
I think we need a little more specific information in order to provide
you with really helpful information.
Grtz,
Francis
OP is talking about displaying equivalent of PDF in a webbrowser.You
will need some sort of COM technology to do it. OOP is a style of
programming and not a technology which will yield this result. These
are two orthogonal issues.
---
Ajay
> With no idea of the details of COM I started reading about it and
> find a lot of different approaches. Can someone please recommend me
> where to start? I am looking for some article suiting my situation
> or for some example which solves a similar task.
For creating an OLE Server,
The well-known MSDN sample is Scribble
The best book was "Inside OLE 2" (Kraig Brockschmidt)
OO allows you to write factory methods like this:
enum Format
{
HTML,
PDF,
etc...
};
Renderer * CreateRenderer(Format format)
{
if(format == HTML)
{
return new HTMLRender();
}
else if(format == PDF)
{
return new PDFRenderer();
}
}
Under the hood this may use COM or not. Since COM is quite complicated
it may be preferable to use simpler OO constructs.
Grtz,
Francis
I am not sure there is choice. The point I am making is that you will
need COM to write the control. Whether you use OO is a mute point. Its
orthogonal to what OP is asking.
--
Ajay
]
Do you simply want your new application to support multiple document
formats. Or do you want your new application to be able to plugin
runnable code from the other applications?
The latter.
What I would like is that my new application has
a main frame and several child frames. And each
child frame will be the main frame of one of the
other applications. That would be perfect.
I found http://www.codeproject.com/KB/COM/mfc_autom.aspx
quite useful, but that doesn't solve the task in
the parent/child frame manner I do imagine.
Then indeed you need COM.
> What I would like is that my new application has
> a main frame and several child frames. And each
> child frame will be the main frame of one of the
> other applications. That would be perfect.
>
> I foundhttp://www.codeproject.com/KB/COM/mfc_autom.aspx
> quite useful, but that doesn't solve the task in
> the parent/child frame manner I do imagine.
It's probably hard to create such an application if you aren't
familiar with COM. I am no expert on it either though. Maybe it's
worth looking into the Google code and Sourceforge archives for sample
code. It helped me when I needed to create an Internet Explorer
plugin.