Solved

Clubbing various Classes

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LINQ return type for nested group query 6 74
VB 6.0 printer how to align 6 58
MsgBox 2 48
Search combo error "Data Type Mismatch in Criteria Expression" 2 53
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…

863 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

20 Experts available now in Live!

Get 1:1 Help Now