Home All Groups Group Topic Archive Search About

Call EXE method from DLL using named instance

Author
24 Jul 2006 8:03 PM
pvveeramani
Hi
Is there a way that I can call a method in an EXE (managed code,
VB.NET) from a .NET DLL by passing a reference to the instance of the
EXE? Multiple instances of  EXE might be running and loaded in memory
and I need the DLL to invoke a method within the running instance by
passing a reference (such as the application title, window handler
etc).

TIA

Author
24 Jul 2006 8:31 PM
GhostInAK
Hello pvveeram***@gmail.com,

Whoa.  That's just.. messed up.  You call function in DLLs from applications..
not the other way around.  Rethink your architecture.

-Boo

Show quoteHide quote
> Hi
> Is there a way that I can call a method in an EXE (managed code,
> VB.NET) from a .NET DLL by passing a reference to the instance of the
> EXE? Multiple instances of  EXE might be running and loaded in memory
> and I need the DLL to invoke a method within the running instance by
> passing a reference (such as the application title, window handler
> etc).
> TIA
>
Author
24 Jul 2006 10:03 PM
pvveeramani
Well, not quite... The DLL acts as a wrapper class and the method that
invokes the call to the EXE is actually called from an Access VBA
module.




GhostInAK wrote:
Show quoteHide quote
> Hello pvveeram***@gmail.com,
>
> Whoa.  That's just.. messed up.  You call function in DLLs from applications..
> not the other way around.  Rethink your architecture.
>
> -Boo
>
> > Hi
> > Is there a way that I can call a method in an EXE (managed code,
> > VB.NET) from a .NET DLL by passing a reference to the instance of the
> > EXE? Multiple instances of  EXE might be running and loaded in memory
> > and I need the DLL to invoke a method within the running instance by
> > passing a reference (such as the application title, window handler
> > etc).
> > TIA
> >
Author
25 Jul 2006 2:55 PM
Ken Halter
<pvveeram***@gmail.com> wrote in message
news:1153778635.866146.138800@b28g2000cwb.googlegroups.com...
> Well, not quite... The DLL acts as a wrapper class and the method that
> invokes the call to the EXE is actually called from an Access VBA
> module.


Unless things have drastically changed for the worse, a DLL is, by
definition, an in-process server. Each exe will reference a different
instance of that DLL. Normally, the way to "call" methods in a standard EXE
(vs and Out of process server... which I have no idea if dotNet supports or
not), you reference your DLL from the EXE, call a method/set a
property/whatever in that DLL and, sometime later, the DLL fires an event.
The exe can trap that event. The DLL can pass any information to the exe as
arguments to the event handler.

I'm just 'poking around' here though so..... In VB6, this kind of stuff is
gravy. Especially when dealing with a VBA back-end.

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm