|
Hi, I would like to know the diffenrce between vb.net and c#.net based on oops. What are there in vb.net or not there c#.net or vice versa.
thanx,
yamini
|
|
|
|
|
"Oops" is what you say when you do something like accidentally deleting a weeks worth of work. Needless to say, "oops" should always be avoided.
I suppose that you are more interrested in OOP; object oriented programming.
Both VB.NET and C# are fully object oriented (as opposed to for example C++ and Delphi, which are procedural languages with OOP support). When it comes to OOP, there is no difference in what you can do with VB.NET and C#. The both compile into IL code and use the same framework, so the resulting code is quite similar.
---
single minded; short sighted; long gone;
|
|
|
|
|
Guffa wrote: Both VB.NET and C# are fully object oriented (as opposed to for example C++ and Delphi, which are procedural languages with OOP support).
I would like to think of C++ as an OOP language with procedural support for backwards compatibility with C.
codito ergo sum
|
|
|
|
|
BadKarma wrote: I would like to think of C++ as an OOP language with procedural support for backwards compatibility with C.
I can understand that you would like to think of C++ that way.
What makes C# fully object oriented, is that the entire structure of a program is based on object orientation. In C++ you can put code inside methods in classes if you like, but in C# there is no other place to put any code. In C++ you can put data inside classes if you like, but in C# there is no other place to put it.
In C++ the support for object orientation has beed added to the language, while in C# the language itself is object oriented.
---
single minded; short sighted; long gone;
|
|
|
|
|
Guffa wrote: In C++ you can put code inside methods in classes if you like, but in C# there is no other place to put any code
And this is the reason why one uses many static functions to simulate the procedural approach of C/
C++
Imho, fully OO doesn't provide the best way to program, nor does fully procedural provide it. The best way is a mix of both. So my quote:
Guffa wrote: BadKarma wrote:
I would like to think of C++ as an OOP language with procedural support for backwards compatibility with C.
was in fact a little joke
codito ergo sum
|
|
|
|
|
thanx but this is not the answer as in an interview i was stressed on this question. Some thing we cannot do in vb.net but we can do in c#.net
|
|
|
|
|
There are things that you can do in C# that you can not do in VB.NET, like unsafe code and operator overloading, but that has really nothing to do with OOP.
---
single minded; short sighted; long gone;
|
|
|
|
|
There are things that VB has and C# does not, and vice versa. None of them relate to OOP. In fact, there are central things that a language needs to be object oriented, and VB.NET and C# have them all, or they just plain would not be OOP.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Hey,
I'm making a progress screen for an application and when I'm uploading a file he gives the "percentage progress" IN the text (realtime). That's nice and good BUT I always have to do:
txt1.Text = txt1.Text.replace(previousPercentage, newPercentage)
And because there is a lot of text in my textbox it starts to blink when it's refreshed (it doesn't blink when I add something to it).
How can I solve this problem?
thx!
|
|
|
|
|
How often are you running the replace command ? Perhaps you need to run it on a string and then put that string in your label ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Every 1sec (if you do it 50times a second its normal it blinks :p)
And I place the wholl string in the txt in one time (every 1sec)
thx
|
|
|
|
|
Wrap the update up with a BeginUpdate() , EndUpdate() block.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
txt1.BeginUpdate() ? --> doesn't work
|
|
|
|
|
Not the textbox, but the whole update of your control.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hey,
Do I have to import something for that? And what do you mean with the whole update of your control?
Do I have to make a new class, instance, interface? Our just:
BeginUpdate();
ApplicationDirector.Instance.removeCharachtersFromProgressScreen(lenghtWrittenString);
EndUpdate();
(but that doesn't work)
|
|
|
|
|
Say you have a progressbar control with the text on it (we'll call an instance of it superProgressBar), then you would normally do
superProgressBar.BeginUpdate();superProgressBar.Increment();superProgressBar.EndUpdate(); The Increment method would be responsible for updating the scroll bar and writing the text on it.
Also, you might want to consider setting up double buffering. Use the following
this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer,true);
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Class C
{
}
Class A
{
Private C;
}
Class D : C
{
}
Class B : A
{
Private D;
}
It comes to this that when I have a member of type B, I have also C and also D in it. How can I override C in it?
Thanks alot for the helpers
NaNg.
|
|
|
|
|
Use virtual keyword for C.
Mazy
"This chancy chancy chancy world."
|
|
|
|
|
It sais "invalid modifier 'virtual' for C".
I'll try Explaining again...
I have these classes:
public Class C<br />
{<br />
<br />
}<br />
<br />
public abstract Class A<br />
{<br />
protected C;<br />
}<br />
<br />
public Class D : C<br />
{<br />
}<br />
<br />
public Class B : A<br />
{<br />
private D;<br />
}
When I do this: B = new B(); , I have D AND C in B.
And I need ONLY ONE, which is the newer one - D.
How can I make the Class A use the new one (D) insted of the old one?
|
|
|
|
|
Hello. I have to make a program, that is listening to keyboard, and if some combination of keys are pressed, it blocks other key.
EXAMLE - if i press "Lshift+Rshift" the F1 key is blocked.
How can i do it? How can i get the combination of 2 keys?
One nation - underground
|
|
|
|
|
Can't you log the key presses?
You can make a buffer like this:
IF( a key is down add to buffer)
IF( THAT key is released remove from buffer)
|
|
|
|
|
Hello,
If you need it for your WindowsApplication, you could use the KeyDown event of your main form (KeyPreview has to be true).
this.KeyPreview = true;
this.KeyDown += new KeyEventHandler(CheckKeys);
private void CheckKeys(object sender, KeyEventArgs e)
{
if ((e.KeyCode == Keys.F1) && (e.KeyCode == Keys.RShiftKey) && (e.KeyCode == Keys.LShiftKey))
e.Handled = true;
}
If you want to log all keybord entries of your a computer, I think no one will help you here!
All the best,
Martin
|
|
|
|
|
Did anyone installed CodeKeep plugin ? I tryed, but it doesnt seems to work. After install, i copy files to directory listed in help file, but i can't find this plugin in VS.
For people, who don't know what is CodeKeep - it is plugin, where a lot of small but usefull parts of code are kept.
One nation - underground
|
|
|
|
|
I have an object where I do 'special' cleanup in case of exception
my code is somewhat like that:
void Method()
{
try
{
Something();
}
catch
{
SpecialCleanup();
throw;
}
finally
{
NormalCleanUp();
}
}
my problem is that when an exception is thrown VS break into the catch clause and I have no idea what causes the exception.
I also tried
catch(Exception ex)
{
SpecialCleanup();
throw ex;
}
but the ex.StackTrace is reinitialized and I have no idea of the problem!
any tips on how to to be able to debug that?
for now I wrote:
#if !DEBUG
catch
{
SpecialCleanup();
throw;
}
#endif
but I would like to catch meaningful stack trace at runtime as well....
|
|
|
|
|
Is there any return statement in "SpecialCleanup()" method also am assuming that the exception could be from SpecialCleanup() method only so you are not able to figure out what was the original exception.
I would suggest that you log the stack trace as soon as the exception is raised !!! Use exception handling block and logging block provided by MS ...
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|