Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing mmUser
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01013572
Message ID:
01013589
Vues:
19
mmUser User = mmAppBase.Factory.CreateUserObject();	
Console.WriteLine(User.InitVecField);
>
>If I comment out the Console.WriteLine() line above, it will compile and I can step through the code and watch it actually create a JdaUser object. Does anyone know how I can get the compiler to realize that the JdaUser object will be created so my InitVecField member should be available to me???
>
>Matthew J. Price

In your code above, try this instead:
mmUser User = mmAppBase.Factory.CreateUserObject();
JdaUser jda = (JdaUser)User;
Console.WriteLine(jda.InitVecField);
This way, the framework still sees the user object as an mmUser class, but when you need to access the JdaUser specific property, you can explicitly cast it to that type object for your specific use at that time.

HTH,
Chad
_________________________________
There are 2 types of people in the world:
    Those who need closure
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform