• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

Clubbing various Classes

I have a set of classes for common functionalities that I include in almost every project I execute. These are the classes with common functionalities like Date validations, keypress validations etc.

I would like to create a DLL with all these classes in it so that I shall only refer to that DLL.

I want to know implications of two things:
1. What will happen if I make some changes to this DLL by modifying existing classes or add new classes to it. I do not understand the versioning effect that's why I am asking this question.

2. Is it a good idea to create a DLL like this or there are some better options?
0
Sethi
Asked:
Sethi
  • 3
  • 2
1 Solution
 
DabasCommented:
Hi Sethi:
It is quite easy actually.
I assume you are referring to VB6 here.

The important fact to take care of is to compile the DLL with Version Compatibility set to Binary.
This means that VB will not let you make changes to your DLL that might not be "Backwards" compatible with a previous version.

For debugging purposes, you can load the DLL project in the same group as the project that is using your utilities.
(Use Add Project.. from the file menu)

AS to your question 2), I think it is quite a good idea.

Dabas
0
 
SethiAuthor Commented:
Point 2 is certified. So I am going ahead with it.

This is what I have analyzed according to what you are saying and what I visualize:

I create say version 1 of the DLL and save it in System32 and refer it in one of my projects. The DLL as you say will be compiled with Binary option.

After 2 days I add two more classes in it and compile it again, remove the previous version from Sytem32 and save this version there. Will the project referring to previous version run?

After 2 days, I try to change the name of an existing function in a class of this DLL and compile it. I think I will get an error becuase this was it will not be COM compatible. Right?


 
0
 
DabasCommented:
Sethi:
You are right.
Your DLL does not have to reside in System32 (It can)
When you set the binary compatibility you are prompted to the exact place where the dll lives.

So after your first 2 days, you just compile to the right place (by compiling I suppose File->Make MyDLL.DLL is meant)
Any program using this DLL will not be affected, since you only added new classes to it.

After the next 2 days, you try to lets say add another parameter to one of your functions. This would cause a compatibility issue. You will get a message explaining why the compilation does not work. You have the option of breaking the compatibility, or rewriting your code.



Dabas
0
 
SethiAuthor Commented:
Thanks Dabas. I wanted to be sure about these issues before going ahead. I will get back to you in case of any problem.
0
 
DabasCommented:
Thanks.
No problem.

Its actually big fun when it works!!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now