Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am adding a reference to .dll file in an application.

How can we do enhancements to a .dll file methods. or to say how can i add my code
to a method of a .dll file to satisfy my requirement.

I searched in google but I couldn't get a solution.

Please let me know..
Posted
Comments
Richard MacCutchan 11-Apr-12 7:37am    
You cannot add enhancements, but you can write your own methods that will call the methods of the dll.

It really depends on how the classes in the assembly where constructed. You can use partial classes or patterns such as Dependency Injection or Inversion of Control(IoC), Managed Extensibility Framework (MEF)
 
Share this answer
 
v2
Comments
Reza Ahmadi 11-Apr-12 13:02pm    
Could you please tell me what was the reason for that vote?(2)
If I am correct, a dll should be used as it is.
And I suppose there are some copy rights involved with the code that is not owned by you. Be aware of this factor before trying any fancy methodologies
 
Share this answer
 
Comments
[no name] 11-Apr-12 12:43pm    
So you use the .NET Framework as is? You have not extended a control or other class? Did you get permission from Microsoft before doing so?
Lakamraju Raghuram 11-Apr-12 12:48pm    
I have utilized say System. Windows.Form to create my own control, but I never injected or screwed Windows.Form assembly itself and this is what I got when OP told about enhancing dll. If he is speaking about extending an dll/assembly then your statement applies else my statement holds.
Lakamraju Raghuram 11-Apr-12 13:01pm    
I suppose Richard MacCutchan got it in the same sense:
Quote Richard : "You cannot add enhancements, but you can write your own methods that will call the methods of the dll."

hmmm...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900