Re: MDI application embedded into DLL



Thank you for all your help,

I think that I haven't any other choice; I must adapt an architecture based on the OLE technology. But I have one last request: can you give some links (tutorials) that introduce the subject?



Thanks at all

Adel



"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> a écrit dans le message de news:tok0t390ggkkrq5c9edveo9d0drbcvq2d0@xxxxxxxxxx
It's called "egineering decisions". If you want MFC behavior, you write in MFC. If you
want to move some of that behavior to a DLL, but still use the basic MFC infrastructure,
you create an extension DLL. If you do not want the base MFC functionality (sharing
resources with the DLL, for example), you write an ordinary MFC DLL. If you want to
presume an MFC infrastructure and run it out of Visual Basic, you are doing cross-language
programming, and it probably won't work very well.

Now, you CAN write a window that has a toolbar or a menu, but if embed this in a DLL in a
way that is language-independent, it won't quite match *anyone's* image of an app, because
you will always have some kind of secondary window and toolbar.

But if you do it as an OLE embedded document, and write an OLE server as your app, then
you can embed your app in anything that understands OLE interfaces, and you can use its
toolbar, menu, etc because when an embedded object is used, it can interface to the basic
infrastructure that is there via the methods. It does require that the hosting app
understands OLE embedded documents (VB and C# have support for this) but you can't just
toss it at some random app and have it work.

OLE embedded documents are nontrival apps to write, but it sounds like it was what you are
asking for.
joe

On Thu, 6 Mar 2008 20:10:41 +0100, "AYARA Adel" <adel.ayara@xxxxxxxxxxx> wrote:

Hi,

But I can't use a MFC Extension DLL with a non MFC application and my DLL
must be used by two main applications: one is MFC application but the second
is written in Delphi language.

==> "Only MFC executables (either applications or regular DLLs) that are
built with the shared version of MFC can use an extension DLL" (MSDN)



So I use a regular DLL

==> "A regular DLL statically linked to MFC is a DLL that uses MFC
internally, and the exported functions in the DLL can be called by either
MFC or non-MFC executables" (MSDN)



But I don't Know how can I launch the DMI framework via this regular DLL
??!!



"Ajay Kalra" <ajaykalra@xxxxxxxxx> a écrit dans le message de
news:064ba92b-13af-44c3-be4d-6bdc6c470a05@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

There is nothing special in writing a DLL. There is nothing
extraordinary about MDI behavior in a DLL. Its going to be a DLL with
whatever functionality you choose. It can contain MDI functionality as
well including views and frames.

Start you creating a MFC Extension DLL and exporting a class which can
be used in other modules (exe and DLLs).

---
Ajay


On Mar 5, 1:45 pm, "AYARA Adel" <adel.ay...@xxxxxxxxxxx> wrote:
OK,

The main application (MFC MDI) has a lot of components called by clicking
in
the main toolbar. Each component is embedded into DLL written in Delphi
language and the main application uses functions exported in these DLL.
But
one must be written in C++ (let's say "cour") and must have the same
functionality that a MDI MFC application such as open several documents,
work in these documents and save them. The component "cour" have also its
main toolbar containing functionality like open, save, print, print
preview,
copy, paste, undo, etc. and I want that this component (cour) be embedded
into DLL and shared by another main application (not written in C++). So,
I
want to build the component "cour" in the form of DLL with its own MFC
classes (view, document, mainframe, etc.) and export some functions to be
called by the two main applications.

In summary, I want to have a DLL component that has the same behavior that
a
MDI application but I can't do it with the three forms of MFC DLL. In
these
three forms, I haven't the view, document and mainframe classes and I
don't
know how to start the MFC framework in these DLL to open document or to
create new document in a child frame.

Thanks for interesting

Aa

"Ajay Kalra" <ajayka...@xxxxxxxxx> a écrit dans le message
denews:75983db2-0a4d-40fa-818d-d7d230ff8a0d@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Its not clear what you are trying to do. Are you asking to execute
commands between two instances of an application? Why do you need to
use ShellExecute to execute commands?

---
Ajay

On Mar 5, 5:21 am, "AYARA Adel" <adel.ay...@xxxxxxxxxxx> wrote:

> Hi,
> Perhaps, I didn't explain very well what I want. In fact, i have a > main
> MFC
> MDI application composed of some DLL components. One of these > components
> is
> shared by more than one main application and it has a same behavior > that
> a
> MFC MDI application (open, save and close documents). So I want to > build
> this component into DLL to can share it between the two applications > and
> not
> use simply "shellExecute" because with this solution there isn't
> integration
> between the component and the main application.
> I hope that I'm clear now and i hope that i found a solution to this
> problem.

> Thanks
> Aa

> "Joseph M. Newcomer" <newco...@xxxxxxxxxxxx> a écrit dans le message
> denews:820rs3du2otjc21r7jgd6suj60cibjtu57@xxxxxxxxxx

> > An application can't be "converted" to a DLL. DLLs are DLLs, and
> > applications are
> > applications. There is no conceivable way you can convert an "MDI
> > application" to a DLL;
> > it doesn't even make sense; it is like saying "I tried to make
> > applesauce
> > out of oranges,
> > and I can't find a way to do it"

> > What do you want the DLL to do? It *is* reasonable to do things > > such
> > as
> > put a document
> > class, a view class, or both, in a DLL (as an extension DLL,
> > typically),
> > but that's about
> > as far as you can go. To be a DLL, it would have to be used in the
> > context of another
> > application, and it makes no sense to embed a CMainFrame in a DLL if
> > it
> > is
> > going to be
> > used in the context of another CMainFrame environment.

> > You can "embed" one app in another, by using OLE embedding; but this
> > is
> > a
> > very challenging
> > undertaking, not at all something to do as a beginning project.
> > joe

> > On Tue, 4 Mar 2008 11:28:46 +0100, "AYARA Adel"
> > <adel.ay...@xxxxxxxxxxx>
> > wrote:

> >>Hi,

> >>I have an MFC MDI application that i want to convert into DLL. I > >>tried
> >>the
> >>three types of MFC DLL but i can't have my MDI application. In fact, > >>i
> >>want
> >>to add an export function to my dll that be called by other
> >>application
> >>(not
> >>MFC and not C++) wich run my MDI application embedded into the dll.
> >>How
> >>can
> >>i do it ?

> >>thanks
> >>Aa

> > Joseph M. Newcomer [MVP]
> > email: newco...@xxxxxxxxxxxx
> > Web:http://www.flounder.com
> > MVP Tips:http://www.flounder.com/mvp_tips.htm
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

.



Relevant Pages

  • Re: Simple Input In a MFC application
    ... other MFC programmers have followed parallel lines to augment the MFC in a ... either distributing an extra dll or having to include resources in calling ... which is why I'd use a DLL ... Place an edit control on the dialog ...
    (microsoft.public.vc.mfc)
  • Re: Soft Input Panel SIP
    ... is without MFC support. ... I tried to setup a new projekt Win32 Smart Device Projekt -- DLL add ... // DllGetClassObject - Exported function called to get pointer to ... STDAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv) { ...
    (microsoft.public.windowsce.app.development)
  • Re: Soft Input Panel SIP
    ... It looks like you are trying to create a dll with MFC statically linked. ... If you are you should start with the MFC wizard and create an "MFC DLL" project, instead of trying to paste MFC into a working non-MFC project. ... STDAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv) { ... IsEqualIID ) { ...
    (microsoft.public.windowsce.app.development)
  • Re: Soft Input Panel SIP
    ... Does your device have the MFC DLL installed? ... STDAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv) { ... IsEqualIID ) { ...
    (microsoft.public.windowsce.app.development)
  • Re: MDI application embedded into DLL
    ... Each component is embedded into DLL written in Delphi ... functionality that a MDI MFC application such as open several documents, ... One is a logical component that implements functionality. ...
    (microsoft.public.vc.mfc)

Loading