About
Pricing
Community
Teams
Start Free Trial
Log in
Rama Tito
asked on
5/19/2011
Convert code from visual basic 6 to C#
Hi, I need to change the code from vb 6 to C#. the code as follows
Private Sub MSComm1_OnComm()
Dim inBuff as string
If MSComm1.CommEvent = comEvReceive Then
inBuff = MSComm1.Input
End Sub
C#
5
1
Last Comment
Todd Gerbert
8/22/2022 - Mon
TonyReba
5/19/2011
private void MSComm1_OnComm()
{
string inBuff = null;
if (MSComm1.CommEvent = comEvReceive)
{
inBuff = MSComm1.Input
}
}
ASKER CERTIFIED SOLUTION
kaufmed
5/19/2011
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
kaufmed
5/19/2011
@TonyReba
You have a syntax error on line 4 : )
TonyReba
5/19/2011
true dat, hehe
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Todd Gerbert
5/19/2011
The .Net Framework (e.g. C#) has some built-in support for serial communications,
http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx
, I would think the System.IO.Ports.SerialPort
.Net class would be much more robust than the COM-based MsComm control.
{
string inBuff = null;
if (MSComm1.CommEvent = comEvReceive)
{
inBuff = MSComm1.Input
}
}