468,786 Members | 1,764 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,786 developers. It's quick & easy.

How to call windows app classes(exe) from DLL???

I have a solution includes 2 projects the 1st one is a class library project
and the 2nd is windows application.
Normally i can use the classes wich in the 1st project(DLL) after add
refrence for this project at the windows application(2nd project) but the
problem is i can't do the versa (how can i call any classes located in the
windows application project from the DLL(1st project)...
for example i need to call bank_win.Form1 class which is located at the
windows application from the class library DLL project.
Nov 16 '05 #1
1 3779
You can declare an interface in your class library, which is implemented
by your form or another class in the Windows Forms application. Let the
classes in your class library call instances of that interface.

This is good because it gives you a chance to design your class library
so that you aren't dependent on what kind of application is using it.
This enables you to reuse it in more than one scenario.

Another way could be to declare delegates in the class library, and call
the Windows Forms application's methods via those.

Regards,
Joakim

Abdalla Fawaz El-Hawary wrote:
I have a solution includes 2 projects the 1st one is a class library project
and the 2nd is windows application.
Normally i can use the classes wich in the 1st project(DLL) after add
refrence for this project at the windows application(2nd project) but the
problem is i can't do the versa (how can i call any classes located in the
windows application project from the DLL(1st project)...
for example i need to call bank_win.Form1 class which is located at the
windows application from the class library DLL project.

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by cplusplus | last post: by
2 posts views Thread by sincethe2004 | last post: by
4 posts views Thread by CsharpGuy | last post: by
4 posts views Thread by Kiran | last post: by
1 post views Thread by shakthi | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.