PC Review


Reply
Thread Tools Rate Thread

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

 
 
Abdalla Fawaz El-Hawary
Guest
Posts: n/a
 
      12th Feb 2005
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.


 
Reply With Quote
 
 
 
 
Joakim Karlsson
Guest
Posts: n/a
 
      12th Feb 2005
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.
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pass reference cross classes via method call? John E. Microsoft C# .NET 3 1st Dec 2005 10:48 PM
How to use C# to call the existing libraries containing unmanaged C++ classes directly? joye Microsoft C# .NET 2 19th May 2005 11:37 AM
Call mainForm method in other classes Andy Microsoft C# .NET 1 26th Feb 2004 09:06 AM
call c++ classes within c# code cle Microsoft C# .NET 2 11th Sep 2003 02:23 PM
call c++ mfc classes directly out of c# classes cle Microsoft Dot NET Framework 1 11th Sep 2003 06:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:11 PM.