So I have this custom class right? I took a lot of time coding it myself at home. I want to include it in a project here at work. I just don't want to use the code at all because then my work would assume ownership of that code. So what I want to do is compile my class into a .dll or something like that for use within the app I'm working on.
Which brings up 2 questions...
1. How can I compilie my class into a .dll file (or something like it)?
2. How do I then use that object in my application?\
Thanks...
Loading

spyder.snyperPosted Sep 10, 2007, 10:57 AM
Oh sweet!
Thanks a ton for clearing this up!
AlanPosted Sep 10, 2007, 5:31 AM
That's right.
I usually place my own custom dlls in the same folder as where the executable itself is installed.
It's also possible to package the dll with the executable as a resource. The first time the executable is called the dll can then be streamed to disk. However, in the circumstances, you may prefer to keep the executable and the dll entirely separate.
spyder.snyperPosted Sep 9, 2007, 5:33 PM
Now after I compile my new project here at work, and have that .dll file used... Do I also need to have that .dll file go out with the compiled executable??
AlanPosted Sep 9, 2007, 5:10 PM
1. Create a new Class Library project within VS, copy your class's code into that and build it in the usual way. This will create a .dll file.
2. To use the dll from another project, right click on the project's name in Solution Explorer and select Add Reference from the context menu. Browse to where your dll is stored and add it to the project.
You will then be able to use the custom class as though it had been defined in the project itself. If the custom class is within a namespace, then 'using' that namespace in the project will avoid the need for the class name to be fully qualified.