That's not even right the immediate base of class3 is class2 not class1.
And who wants to pollute their code with a bunch of extra methods when there should a be a way to syntactically statically bind to any method in the inheritance tree.
Yes it's not something you need to do often and it might mean that there is something wrong with your design but there still should be a way to do it, it's not unsafe.
if you have a Base object or a Base-derivative pointed to by a Base reference,
it will do the virtual call, as intended by the virtual keyword.
there is the "base" keyword, but its use is restricted (see paragraph 7.5.8 in the C# ref man)
to a few places, all inside classes that derive from the base class.
So yoy cant do myObject.base.methodname()
Conclusion: the virtual stuff really hides the base methods/properties.
And my first impression is that is how it should be.
Why is it you want to get at the base implementation from outside of the class anyway ?
There is of course a trick to do it, by providing a Clone() method in the base class,
something that takes a Base or Base-derivative and creates a new Base object, equivalent
to the base-part of the object (similar to a copy constructor), stripping off all
Thanks for the reply and that's pretty much what I thought that you can't.
This kind of came up from a friend of mine who is trying to impliment something like the boost serialization library in C# in that he has a secondary class that is walking the inheritance tree of the class to serialize by exlicitly serializing the base classes states. It kind of does this in a funny way and I'm not entirely convinced it's the right way.
Beyond that I have run into times where it was handy to do this, usually because something beyond my control was implimented improperly.
with a spoonful of lateral thinking I read your sentence "Note that it is possible to invoke the hidden virtual method by accessing an instance of D through a less derived type in which the method is not hidden" as "WTF just give the method a name that remains visible...".
The standard thread pool allows 25 threads per processor, but there are a number of improved thread pool implementations that allow you to go beyond this. You may want to look at this[^] implementation.
I have a problem. I was using a soap serialization in assembly called "Catalog". I've got a file Data.xml.
Then i was trying to serialize this file to another program ("LogBook").
I've got error: Parse Error, no assembly associated with Xml key a4:http://schemas.microsoft.com/clr/nsassem/CatalogBeta/Catalog_2.0%2C%20Version%3D184.108.40.206%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull strBook
What should i do ? How can i deSerialize this file ?
The assembly you are serializing into also needs to know about the data structure that was serialized. If you want to serialize the data like this, you will need a third intermediary assembly that contains the class definition that is referenced by both of the other assemblies.
Remember, serialization and deserialization are essentially a transport mechanism to take the binary state of an object from one context (serialization) and transfer it to another context (deserialization). Both contexts must understand the data structure being manipulated.
In just two days, tomorrow will be yesterday.
I would like to be able to let people enter special fields and HTML into a Rich Textbox and then have it convert to HTML. Here is the plan. Let's just say I have these 2 fields, firstname and lastname. What I would like to have happen is to allow the end user to save this....
into a text document and then I would have the app read the text document in, look through the doc for those special words and then replace them with the real values from the database. With that information I would just send it to browser object for display. What this is for is a phone integration and when the user clicks on the incoming call I would like them to see more information about who is calling. Giving the user a tool to add any fields they want and being able to format it anyway would be cool. I'm just not sure how to make sure everything stays HTML safe with chars like " ' / and the like. Anyone doing anything like this or could lead me into the correct direction please? Much thanks!
The last time I did any Windows/Win32 programming was before .NET was introduced!! Since then I've been focused on server-side Java applications but now I need to develop a Windows service. I figure C# should ease the transition into .NET and so I'm writing to this forum. If this is not the right forum for this question, please let me know which one is.
I'm looking for pointers on the quickest approach to go about implementing a service which listens in on both SMTP and POP3 traffic and based on the message headers perform some action. The behavior is just like an anti-spam application's service that monitor email.
So far, I've found sample code for creating a service. I'm hoping to find sample code for intercepting SMTP/POP3 traffic as well as an API similar to JavaMail which will help with parsing RFC822 messages.
If anyone here has previously developed an anti-spam application and is willing to be a consultant, please contact me directly. This would actually be my preferred approach.
SP Consulting, Inc.
Hi all, I want to download an xls file from remote location (Please note that its not FTP , its live ip, like myip/shared/info.xls) .I have been searching for any class or library but no success till yet. Can someone help me ? Thanks in advance.
Also, please guide how to open an excel file for reading data from it. Thanks
ah sorry, I forgot to inform, I am trying this with windows forms application, not web application, I guess incase of web, you can also do that using Response object, but I am looking for some control/class/library in windows app.