Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Step by step to create dlls to hold two levels of subcla
Message
De
07/10/2007 17:31:03
 
 
À
07/10/2007 15:46:35
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
Divers
Thread ID:
01259275
Message ID:
01259294
Vues:
19
Alex,

It's not quite as easy in .NET. You wouldn't be able to create a sub-class-library, which is what you're showing in your VFP example.

Each Project in a .NET Solution will be compiled to a .DLL. But a Project is not actually sub-classed from another DLL. You'll need to create classes in your Project that inherit from each of the Framework classes.

So, you create your IBusiness Project, IBusiness, which will end up compiling into an IBusiness.DLL. Then, you create a class (right-click the Project, Add | Class), then change the code to this:
public class MyBizClass : Business.FrameworkBizClass
{
}
Do this for every class in the Business.DLL that you wish to sub-class. You can either put all the new classes in one file in your new Project, or you can have a separate file for each class in the Framework class. It will probably depend on what class you're sub-classing.

You will also have to add a reference to the Framework class library (right-click the Project, Add References) ... how you do this part depends on whether your Framework classes reside in the GAC, anywhere on your PC or in a central depository accessed by all developers, and also depends on whether you're using Source Control.

~~Bonnie





>This is a very basic/newbie question.
>
>We are starting a .NET application using Strataframe framework. In the past (with VFP) I've had good results following the advice to subclass a purchased framework twice: once to be to shared among several apps and once again specific to an app.
>
>It's been suggested that I create a dll for each level of inheritance classes. Where can I find step by step instructions to create dlls that hold each of the two levels of subclasses? Don't be embarrased that your suggestion is too basic :) I am asking how to do the equivalent of these VFP steps:
>
>MD c:\IFramework\Classes
>CREATE CLASSLIB C:\IFramework\Classes\IBusiness.vcx
>CREATE CLASS IBusiness OF C:\IFramework\Classes\IBusiness.vcx AS Business FROM c:\Framework\Classes\Business.vcx
>
>And then later,
>MD c:\MyApp\Classes
>CREATE CLASSLIB C:\MyApp\Classes\ABusiness.vcx
>CREATE CLASS ABusiness OF C:\MyApp\Classes\ABusiness.vcx AS IBusiness FROM c:\IFramework\Classes\IBusiness.vcx
>
>Thank you.
>
>Alex
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform