Solved

Clubbing various Classes

Posted on 2004-03-26
5
203 Views
Last Modified: 2010-05-01
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
Comment
Question by:Sethi
  • 3
  • 2
5 Comments
 
LVL 27

Expert Comment

by:Dabas
ID: 10693200
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
 
LVL 18

Author Comment

by:Sethi
ID: 10693243
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
 
LVL 27

Accepted Solution

by:
Dabas earned 500 total points
ID: 10693264
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
 
LVL 18

Author Comment

by:Sethi
ID: 10693291
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
 
LVL 27

Expert Comment

by:Dabas
ID: 10693298
Thanks.
No problem.

Its actually big fun when it works!!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question