?
Solved

Clubbing various Classes

Posted on 2004-03-26
5
Medium Priority
?
214 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month14 days, 1 hour left to enroll

800 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