Call EXE method from DLL using named instance

P

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
 
G

GhostInAK

Hello (e-mail address removed),

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

-Boo
 
P

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.
 
K

Ken Halter

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top