|
They are both much of a muchness. Which one is preferable is based on which ever you prefer using. Or if you are needing to hire developers, which ever one has a supply of good quality (assuming that's what you want) developers in your area.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Thanks colin . i am C++ developer and i am familiar with .net but not a expert . But after reading these replies some question got in my mind . may be if it out of topic just ignore my question.
my question in what areas does C# and VB.net defer , is it just programmer preference ? or is there any functional areas where these two will be defer ?
if my question is too much then pls ignore it .
Thank you very much for you time.
|
|
|
|
|
Vijjuuuuuuuuu........... wrote: my question in what areas does C# and VB.net defer , is it just programmer preference ? or is there any functional areas where these two will be defer ?
There are minor differences in the code that is generated by the compiler, but nothing that would get me worked up. The product groups have a policy to keep the two languages broadly in sync, but there are some differences. e.g. VB9 has inline XML - In other words you can write XML in the language and it will create a proper DOM for it. In C# you have to create the objects or parse an XML string to get to the same DOM.
They way I look at it is that there are about 100 differences (style/syntactic) and over 100,000 identical things (the methods on the .NET Framework)
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Thank you so much for your time Colin.
i really appreciate for your time .
|
|
|
|
|
I'm absolutly not a expert on the subject, but my friends tell me that you get a lot of hangups when using multi threeds in VB.Net but never in C#.
To be frank the tell me 'u get hangups multi threeding in VB.NET ... i doesn't work'
So I say use C# because you probably sooner or later like to use this solutions.
|
|
|
|
|
Singan wrote: my friends tell me that you get a lot of hangups when using multi threeds in VB.Net but never in C#.
This argument is specious.
You can screw up multi-threading just as easily in C# as you can in VB.
Singan wrote: I'm absolutly not a expert on the subject
Singan wrote: my friends tell me
Singan wrote: So I say use C#
Indeed.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Singan wrote: To be frank the tell me 'u get hangups multi threeding in VB.NET ... i doesn't work'
Sorry, but that is totally untrue, unless they discovered a bug in the VB.NET compiler. Threading is handled by the CLR, and it knows nothing about VB.NET or C#, only MSIL.
|
|
|
|
|
Thanks Singan,
when there is Visual studio , we used to use Visual Basic that is the only front end we used to use.
and i used to do automation project in Visual basic . now i am planning to do some projects to .NET
so i am confused which one to use C# or VB.NET because both provide window application and both looks really the same . both provide data base connectivity and reporting tools etc.. so i thought of asking experts this forum.
|
|
|
|
|
Please ignore this idiot. He's wrong - in fact he couldn't be further off the mark if he insisted the earth was flat.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: in fact he couldn't be further off the mark if he insisted the earth was flat.
I prefer listening to the arguments of the concave earth society myself.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Pete O'Hanlon wrote: he couldn't be further off the mark if he insisted the earth was flat.
Well said! We all know the earth is a cube.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Singan wrote: I'm absolutly not a expert on the subject
Singan wrote: my friends tell me that you get a lot of hangups when using multi threeds in VB.Net but never in C#.
Singan wrote: To be frank the tell me 'u get hangups multi threeding in VB.NET ... i doesn't work'
Singan wrote: So I say use C# because you probably sooner or later like to use this solutions.
There's nothing like arguing a case from a position of no knowledge. This argument is complete and utter rubbish - in fact, it's been a long time since I've heard an argument that is so completely wrong, that it has a degree in wrongness. You do know that threading is a capability of the OS (and encapsulated by the framework on top) don't you? Given that, you do know that there isn't a VB only version of the .NET runtime don't you. So, stop relying on other people to do your thinking for you, and start thinking for yourself. Any idea that starts with "this bloke told me" is almost always guaranteed to be wrong.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Singan wrote: I'm absolutly not a expert on the subject
No, and...
Singan wrote: but my friends tell me that you get a lot of hangups when using multi threeds in VB.Net but never in C#.
it appears your friends are idiots.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Christian Graus wrote: it appears your friends are idiots.
Not only his friends - I have to assume they're his frat buddies from idiots anonymous.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Oooh dear i feel like a rabbit in a wolf pit.
You are probably more or less right, I'll see to get the complete info why.. before I make a input like this again..
|
|
|
|
|
Singan wrote: To be frank the tell me 'u get hangups multi threeding in VB.NET ... i doesn't work'
The friend who told you this is most probably a high school dropout. Tell him he's wrong.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|
I suggest seeking out new friends who know better and actually know how to write code. Your current crop of friends don't have a clue about what they're talking about.
Did you know that VB.NET and C# compile down to the same MSIL code?? Use the same libraries in the .NET Framework?? So how could one work and not the other??
|
|
|
|
|
Hi,
if you were familiar with both languages you wouldn't ask, you'd just choose yourself.
if you were familiar with just one of those languages, there would be no need to ask, use the one you know.
so start learning C#, go buy a tutorial book and study it.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Thanks Deepak for sharing the link
|
|
|
|
|
|
Depends, have you stepped through it ? Might your midi settings be off ? I know I have a program that uses MIDI, but it doesn't play anything, I can't work out what is wrong with my MIDI settings.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Your code plays fine for me. What OS are you using? You may need to set the correct MIDIOut device in the Sound section in Control Panel. If it's Vista or Weven, it's not there so use my MIDI out setter[^] if needed.
Check the volume(s) in your mixer.
I belive from the docs (not tested), to loop, you'll need to get notification that it's finished and start it again. You do this by adding " notify" to your command and sending a pointer (could be a hwnd) or a delegate (function pointer) as the last parameter. I think the message you need is MM_MCINOTIFY (0x3B9).
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I've created a new boilerplate project, pasted and ammended your code.
This works - and loops:
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Shown += new EventHandler(Form1_Shown);
}
void Form1_Shown(object sender, EventArgs e)
{
DoPlay();
}
private const int MM_MCINOTIFY = 0x3B9;
[DllImport("winmm.dll")]
private static extern int mciSendString(string lpstrCommand, string lpstrReturnString, uint uReturnLength, IntPtr hwndCallback);
public bool PlayMidiFile(string midiFile)
{
if (File.Exists(midiFile))
{
mciSendString("stop midi", string.Empty, 0, IntPtr.Zero);
mciSendString("close midi", string.Empty, 0, IntPtr.Zero);
mciSendString("open sequencer!" + midiFile + " alias midi", string.Empty, 0, IntPtr.Zero);
int rtn = mciSendString("play midi notify", string.Empty, 0, this.Handle);
return (rtn == 0);
}
else
return false;
}
void DoPlay()
{
PlayMidiFile(@"C:\Windows\Media\town.mid");
}
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == MM_MCINOTIFY)
DoPlay();
}
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|