0

Well to begin with I have very basic understanding of C#'s OOP power however this is what I want:

I have a function that I want to compile to a .dll, as the project I am working on will be more easier to execute given the power of C#. Although I have the function ready, I don;t have the technical knowledge to create a .dll out if it that may be included in a project and the functions called. Also is there a way to show the 'user' of the .dll what function it accepts and what it returns when it get's included in a project (I am sure the intellisense shows the method parameters when the methods are called), but how does the 'user' know what methods are included?

Also is it possible that my .dll's that I create may be used by someone coding in C++/C?

P.S. I did study the MS Documentation but I did not get it exactly. I am currently trying to learn from another documentation as well.

Thanks.

2 Answers 2

2

You can create a Class Library project, in that project you can have the function inside the class. The output for the class library is a dll file, that you can use with other projects of .Net framework.

For using .Net dll in C++ you may see this post: Using a .net compiled dll inside native c++

Sign up to request clarification or add additional context in comments.

Comments

1

As Habib mentions, creating a .dll is as simple as creating a Class Library project and moving your code there. If you want anything other than simple method/parameter hinting, you need to add XML comments to the class and method signatures, as explained here: http://msdn.microsoft.com/en-us/library/b2s063f7%28v=vs.100%29.aspx

For example:

/// <summary>
/// Adds a user to the users table
/// </summary>
/// <param name="first">User's first name.</param>
/// ... and so on
bool AddUser(string first, string last, string userName, string password);

There's also an option in the project settings dialog to have Visual Studio generate an XML file from all of the XML comments in the project. This XML file can be given to SandCastle Help File Builder (http://shfb.codeplex.com/) to generate MSDN-style doc pages, or you can apply XSLT yourself and host them somewhere convenient...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.