| | |
C# DLL
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
After someone creates a DLL in C# using the Microsoft Visual development environment, how would another programmer take that code, make a new project that includes the DLL's source and make a GUI that uses the DLL'S API?
•
•
Join Date: Aug 2008
Posts: 1,158
Reputation:
Solved Threads: 136
you would just need to add it as a reference in the project
what specific piece are you having trouble with?
what specific piece are you having trouble with?
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
Another thing to do, after you've made a reference to the DLL or project, is to use the using statement to include the namespace included in that DLL file. It's not absolutely required, but it does simplify using methods and classes from the DLL, rather than having to type out the fully qualified name of the method/class.
As a handy tip, you can use object explorer to look through a DLL's functions to determine what you're wanting to use.
As a handy tip, you can use object explorer to look through a DLL's functions to determine what you're wanting to use.
Alex Cavnar, aka alc6379
I have done a few things. I have created a console app to use as the front-end to the project. Then I have added the DLL as a reference like this:
1) In the Solution Explorer right-click "References" and select "Add Reference ...".
2) Select the "Browse" tab.
3) Navigate to the DLL and select it.
4) Add the appropriate using directive to the code file(s) where you want to use the DLL.
I have also found that I can add the Project that the DLL was made in into my new Solution file.
I have included the namespace of the DLL in the "using" section of my code.
And the intelligent type I am using recognizes this class when I declare it in my code.
But it does not seem to recognize all the methods (api's) of the class.
What am I doing wrong?
http://i67.photobucket.com/albums/h2...st_problem.jpg
Strangely, "Equals", "GetHashCode", "GetType" and "ToString" are not seen in the DLL's source code for available methods for this class.
Also, I know that if you double click on the added reference, an Object Explorer should come up showing the available methods. This is not what happens:
http://i67.photobucket.com/albums/h2...no/objects.jpg
So now to look closer at the DLL source code.Could there be a problem in the fact that the constructor ( private NookieBookieDoopieDoo() ) is
defined as a privvate? Could there be a problem that the methods are static?
It looks something like this:
Could there be a problem in the fact that the constructor ( private NookieBookieDoopieDoo() ) is
defined as a privvate? Could there be a problem that the methods are static?
1) In the Solution Explorer right-click "References" and select "Add Reference ...".
2) Select the "Browse" tab.
3) Navigate to the DLL and select it.
4) Add the appropriate using directive to the code file(s) where you want to use the DLL.
I have also found that I can add the Project that the DLL was made in into my new Solution file.
I have included the namespace of the DLL in the "using" section of my code.
And the intelligent type I am using recognizes this class when I declare it in my code.
But it does not seem to recognize all the methods (api's) of the class.
What am I doing wrong?
http://i67.photobucket.com/albums/h2...st_problem.jpg
Strangely, "Equals", "GetHashCode", "GetType" and "ToString" are not seen in the DLL's source code for available methods for this class.
Also, I know that if you double click on the added reference, an Object Explorer should come up showing the available methods. This is not what happens:
http://i67.photobucket.com/albums/h2...no/objects.jpg
So now to look closer at the DLL source code.Could there be a problem in the fact that the constructor ( private NookieBookieDoopieDoo() ) is
defined as a privvate? Could there be a problem that the methods are static?
It looks something like this:
C# Syntax (Toggle Plain Text)
namespace BladaFlabaDab { public class NookieBookieDoopieDoo { private static readonly string SomethingYouDoNotNeedToKnow = @"SLAMADAMNADDORK"; private NookieBookieDoopieDoo() { } public static void Send(string to, string subject, string body) { . . . } public static void Send(string to, string replyTo, string subject, string body) { . . . } private static void InitializeClient() { . . . } } }
defined as a privvate? Could there be a problem that the methods are static?
•
•
Join Date: Aug 2008
Posts: 1,158
Reputation:
Solved Threads: 136
you need to call it like this since it is static
C# Syntax (Toggle Plain Text)
ClassName.MethodName(); NookieBookieDoopieDoo.InitializeClient(); NookieBookieDoopieDoo.Send("to", "replyTo", "subject", "body");
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
![]() |
Similar Threads
- What is BRIDGE.DLL (Viruses, Spyware and other Nasties)
- Loader.EXE and IEDLL.EXE errors (Web Browsers)
- Please help with DLL error message! (Windows NT / 2000 / XP)
- DLL equivalent to xerces.jar (Java)
- ToolBar>dll (Web Browsers)
- Missing system32\hal.dll (Windows NT / 2000 / XP)
- Kernel32.dll (Windows 95 / 98 / Me)
- vb6 executables w/ dll's (Visual Basic 4 / 5 / 6)
Other Threads in the C# Forum
- Previous Thread: Capturing contents of launching file
- Next Thread: how to print "" in c#
| Thread Tools | Search this Thread |
.net access algorithm array asp.net bitmap box broadcast c# check checkbox client combobox control conversion csharp database datagrid datagridview dataset datetime dbconnection decryption degrees design developer draganddrop drawing encryption enum eventhandlers excel file firefox focus form format forms function gdi+ grantorrevokepermissionthroughc#.net hospitalmanagementsystem image input install interface java libraries list loop marshalbyrefobject math mouseclick movingimage mysql netcfsvcutil.exe numeric operator path photoshop php picturebox pixelinversion platform polynomial post programming properties radians read regex remote remoting richtextbox server sleep socket sql statistics string stringformatting study system.servicemodel table tcpclientchannel text textbox thread time timer update usb usercontrol validation visualstudio webbrowser winforms wpf wpfc# xml






