Log in

View Full Version : Making Dll in VB


amit_lalwani
Mar 11, 2007, 09:55 PM
Wat are the steps to make the DLL in vb

Nosnosna
Mar 15, 2007, 02:21 PM
Create a new project of type Class Library (.dll).

Write the code for the functionality needed in the library.

Publish it, and then reference it in the programs that need to use that functionality.

When deciding on the functionality that goes into the dll, you have to keep in mind a few things:

Is this code reusable? If it's only going to be useful in a single program, then it should be in the program itself... there is no advantage in a dll that will only be used by a single program (in overhead... there are potential advantages for other aspects, especially related to updates, though that's a secondary consideration)

Is the function generalized? Wherever possible, you should avoid program-specific or single situation implementations in a general use DLL. For example, if you need the average of three values in this program, you should write a function for the average of any number of values instead... this allows for reuse of that code in other situations.

Is the function trivial? Code reuse is great, but if you have a function for something overly simple, then you don't save any effort by including it in the dll.

Is the function related to the other functions in the dll? Related functions should be grouped into a single library, while unrelated functions should usually be separate. By grouping things together unnecessarily, your dll will encroach on functionality that it doesn't need in most cases, and your distributions will include much more code than is necessary.