Using a DLL library in C# [closed] - c#

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have a DLL library given to me as homework. I was being told the DLL has the capability of raising events. And I will need to be able to handle those events. I am coding in C#.
Can any one please point me to any tutorials online that will serve the purpose.
Atm, all the google results I get is - how to make a DLL or how to use C++ dll in C#; they are not helping me to serve the purpose.
Can anyone help?
Yes, I know how to add a reference and can connect this to my project.

Since you know how to add a reference, all you need is to add the reference to your class with "using [Class Namespace]" and add an event to your event handler.
This link may help you with this part: http://msdn.microsoft.com/en-us/library/ms743596(v=vs.100).aspx

Add a reference to the project by right-click on the reference-folder in your project. Navigate to the dll and add it. Now you can use it like a project which is in your solution.

Related

How to install WH_MSGFILTER? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I am trying to catch all messages that receive another program. As I understand I need to use WinApi hooks, specifically WH_MSGFILTER, but I dont know how to install it properly. Can someone show me complete C# program using different WinApi hooks?
Hooks like that require a DLL that can be injected into another process. You cannot write such a DLL in C#, you cannot get the CLR injected. Only the low-level hooks can work, they don't require injection.
Check this project for an alternative. No idea how solid it is btw.
A process hook to another program requires a native dll (except for keyboard and mouse hooks). Can't be done in C#.

graphical representation of source code [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have some source code in C# that lies in a number of folders.
I need to understand this code as it wasn't written by me. Not only that, I want to learn how enterprise applications are coded. The best way to do that is if I have a graphical representation of classes, inheritance etc. I should be able to see the source code in multiple layers: e.g how classes relate to each other, how properties/methods in these classes relate and call each other, etc. I've heard of enterprise architecture and checked it out, but I don't understand what I've read.
Can anyone suggest something else?
Have you looked at NDepend? It can show you all the dependencies withing the code - eg through graphs;
http://www.ndepend.com
Simply use Microsoft Debug Canvas to get acquainted with the solution.
If you are using Visual Studio right click on project and choose "View Class Diagram".

how create designer in Visual Studio 2010? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I created an item template that generates a .CS file and adds it to the project. I want to create a DESIGNER that is shown everytime the user tries to open this .CS file from the Solution Explorer, just like XX.EDMX and XX.Dsigner.cs
?
Any ideas?
Thanks!!
The short answer is given in the VSSDK reference (on MSDN) page on Designer Initialization and Metadata Configuration page (all keywords are linked on the page itself):
A VSPackage should handle designer initialization by:
Creating an object implementing the DesignSurfaceExtension class.
Register the class implementing DesignSurfaceExtension as providing support for the VSPackage's designer extensions by applying instances of DesignSurfaceExtensionAttribute, ProvideObjectAttribute and ProvideServiceAttribute to the class providing the VSPackage's implementation of Package.
Unfortunately the long answer is going to be extremely long, and in the absence of genuinely good documentation, involve a lot of trial and error. A quick search didn't show any complete examples, so if you're willing/able to, it'd be great if you could share what you figure out.

accessing methods of a dll [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
how to access the methods of a dll in .net using c#
Include the dll in your references folder in your project.
Here is a good article on doing that: http://msdn.microsoft.com/en-us/library/wkze6zky%28VS.80%29.aspx
That depends on what kind of Dll you are talking about. If you are talking about .Net Dll's, that is, .Net assemblies without an entry point, then Abe's answer applies. If you are talking about unmanaged/native DLL's written in C, you should use the Dllimport attribute in defined in System.Runtime.InteropServices namespcae. This link might help you.
.net
load the Assembly using 'Assembly.Load' or adding a reference
use the Classes in the Assembly
unmanaged
Use DllImport

How to convert C# code to C++ [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I have a Data Structure class written in C#. How to convert that to C++ (managed)?
Don't convert it. One of the very nice features of .NET is that the types from one managed language can be used in another. Right-click your C++/CLI project, Properties, Common Properties, Framework and References. Click Add New Reference. Use the Projects tab if your C# project is in the same solution (recommended). Otherwise click the Browse tab and navigate to your C# assembly.
You can see how this is done in the Classes and Structs (Managed) page on MSDN. Just put the equivalent types and logic into your C++ ref class, and you'll make a managed class in C++.

Categories