Solved

Clubbing various Classes

Posted on 2004-03-26
5
188 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now