|
Nitin Sawant wrote: The new modifier creates the New instance(object) of the class
No it doesn't. The new modifier tells the compiler that a method ina derived class is a new implementation and the compiler should hide one of the same name / signature in a base class.
The new operator creates new instances.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Malcolm Smart wrote: and the compiler should hide one of the same name / signature in a base class
So why
class A
{
public void SomeMethod()
{
Console.WriteLine("Base called");
}
}
class B : A
{
public new void SomeMethod()
{
Console.WriteLine("New called");
}
}
public static void Main()
{
A instance = new B();
if (instance is B)
instance.SomeMethod();
RL();
}
writes "Base called" on the console??
Nb. if A.SomeMethod would be virtual and overriden in B , then "New called" would be displayed.
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
gajatko wrote: Nb. if A.SomeMethod would be virtual and overriden in B, then "New called" would be displayed.
Exactly - it is virtual, so the overridden method would be called.
gajatko wrote: public new void SomeMethod()
In class B, you have modified the method as 'new', which removes any inheritance of that method. Type A has no knowledge what so ever of this method now.
gajatko wrote: A instance = new B();
You instantiate a static member of type A with a dynamic instance of type B. Calling the method on this instance will invoke the Type A method, as that is the only method matching the signature, and it has not been overriden.
( I think...!! )
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
|
The first thing you should learn as NIIT is www.google.com. Just out of a bizarre curiosity, I typed both your questions into google, exactly as you typed them here....and guess what....
MP3 - 850,000 hits...hmmm[^]
Txt - 956,000 hits....[^]
Now, as a student, what do you reckon is the better way of getting an answer to these questions? Google, getting nearly 2million responses in less than 0.5 seconds or posting the question here and getting nob all except sarcasm and stupid replies as you are too lazy to even search for this yourself?
Students like you just end up being tomorrow's users...
-- modified at 3:57 Monday 24th September, 2007
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
removed
NIIT Student
modified on Monday, May 17, 2010 10:45 PM
|
|
|
|
|
Nitin Sawant wrote: but i want that from codeproject.com
Why?
OK - you ask on code project. You get maybe 1 or 2 answers. They could be similar, they could be different. YOu look on google, you get a million answers. You look at three or four, or more (there's plenty of them) and you then get a feel for the correct way to do something.
Why I think you want an answer here : It is so you can cut and paste the code, verbatim, without having to understand it, and when you find you can't even do that you have the person who answered your question on hand to guide you through it step by step.
Good luck Sir.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Nitin Sawant wrote: i know there are many results on google but i want that from codeproject.com
You can still use Google to search CodeProject.com. Just suffix
site:codeproject.com to your search query string and Google will restrict the results from CodeProject.com.
Nitin Sawant wrote: i'm new here
Welcome.
|
|
|
|
|
"Students like you just end up being tomorrow's users... "
That was not necessary - Sorry.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
at least, give me the code to play mp3 files, i thought that codeproject members help me thats why i posted my question here.
NIIT Student
|
|
|
|
|
Codeproject memebers will help you with stuff that you have problems with. In this case it seems you have a problem with using google and a codeproject member helped you!
Don't expect people to come running to help you if the answer can be found in a few seconds on google, that just makes you look lazy.
|
|
|
|
|
mess removed
Beginner who was not helped by anyone on codeproject.com
modified on Monday, May 17, 2010 10:46 PM
|
|
|
|
|
you were helped. you didn't tell us you had a problem. you only wanted us to tell you how to do it. Have a go first, when you hit a problem, then ask for help - I will guarantee you will get help then. Don't go off all grumpy because because you asked the wrong question....google for it, have a go, and see the difference a bit of effort makes.;)
CPian who didn't do somebody's work for them
|
|
|
|
|
You are unbelievable. Search for it yourself. If you have a problem with the code, ask about the problem. Don't ask for a general solution to your requirements.
Students like you just end up being tomorrow's users...
(No disrespect to any of my users....)
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Here's the scenario...
Let's say someone found an ipod while he/she was out running, and found that the volume limit was locked (if you own an ipod you'll know what I mean).
(Of course this person handed in the ipod to the local police station and waited 6 months before it was given to him/her )
Has anyone ever tryed, to make a program that could crack the ipod's lock for it's volume limiter (or perhaps heard of one)?
Mark.
|
|
|
|
|
MarkBrock wrote: Has anyone ever tryed, to make a program that could crack the ipod's lock for it's volume limiter (or perhaps heard of one)?
And if so, have they appeared in court because Apple is famously litigous and would have you arrested.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Possibilities for 'Out of Memory Exception'
|
|
|
|
|
You're out of memory.
If you want more detail, you need to provide more info.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
simple .. u'r system doesn't have enough memory as it is required to complete the running program execution
|
|
|
|
|
our application is .net oracle drive based and sometimes we get this error though 2GB RAM is lying free.
In our case, we reset msdtc (specific to our environment).
before c# there was darkness
|
|
|
|
|
Most of the time this is caused by a very stupid programming error. It happened to me when I just started using C#, I did nogt completely understand the concept of properties and made a prperty assign to itself.
It is difficult to give a general way out. Your best chance is to try isolate the probleme, but maybe you have to tear down your complete application to find out which line of code causes the problem.
You may use breakpoints to find out where your application uses operations that appear to take a long time (normally it takes some time to fill such an amount of memory).
Good bug hunting!
Rudolf Heijink
|
|
|
|
|
Hi,
Thanks for the response.....
I want the log details of an application to be saved for every 10 mins....
I made the log details available in textboxes and labels....
How to export the details to the excel sheet....
I have got information regarding exporting the datagridview but i did'nt use datagridview in any part of my code....
Please Help me to transfer the details entered in textboxes and labels to excel sheet without using a datagridview.
Regards,
Priya
|
|
|
|
|
|
Hello!
Thank you very much for looking at and answer my questions.
I develope mobile phone program using c# 2005,I set the anthor property of a datagrid control,but it does not work.I don't why,maybe it have something to do with my program achitecture.Because all my control is added according to a text file,which decide what kind of control to add and their property value,my program read this text file,and add control dynamicly.
Thanks for answering.
|
|
|
|
|
I need to print encrypted customer details as a barcode. then need to scan the data and read back the details.
My approch is like this,
I encrypted the string data using cryptoservices and get memory stream and sen the byte array data as unmanaged byte arra to the printer.
Byte[] bytes = memoryStream.GetBuffer();
IntPtr pUnmanagedBytes = new IntPtr(0);
int nLength;
nLength = Convert.ToInt32(memoryStream.Length);
pUnmanagedBytes = Marshal.AllocCoTaskMem(nLength);
Marshal.Copy(bytes, 0, pUnmanagedBytes, nLength);
PrintDirect.WritePrinter1(lhPrinter, pUnmanagedBytes, nLength, out pcWritten);
How can I read this data back to managed byte array from the scan device.
(BTW am I in the correct path.)
|
|
|
|