[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Tobin Titus

9/30/2002 3:02:00 PM

Does anyone know if you can use Serial IO with C#? I have
tried several things from using the System.IO.FileStream
object to using plain old DllImport. The problem is that
C# doesn't support bit fields. How do I pass a structure
to an API call that requires a bit-field when C# doesn't
support it.

Is there another way to do this? Does anyone know? Is
this the right group to talk to?
1 Answer

NETMaster

9/30/2002 5:34:00 PM

0

DON'T MULTI-POST

My FAQ response:

.NET has no support for legacy ports (COM/LPT)
You have to use PInvoke or Interop...

First understand the Win32 API as described here (C++):
http://msdn.microsoft.com/library/en-us/dnfiles/html/msdn_...

New MSDN article for .NET (mostly C#):
http://msdn.microsoft.com/msdnmag/issues/02/10/NETS...

PInvoke samples for C#:
http://msdn.microsoft.com/msdnmag/issues/02/10/NETS...
http://www.gotdotnet.com/userarea/keywordsrch.aspx?keyword=Se...

or for VB.NET:
http://msdn.microsoft.com/library/en-us/dnvssamp/html/vbcs_usingthecomporti...
http://www.gotdotnet.com/userarea/keywordsrch.aspx?key...
http://www.allapi.net/classlib/class...

or you can use the "Managed Extensions for C++" and write wrappers.
http://msdn.microsoft.com/vstudio/techinfo/articles/upgrade/mana...
http://www.gotdotnet.com/team/...
on your VS.NET path:
...\VC7\managedextensionsspec.doc
...\VC7\migration_guide.doc
MC++ Sample:
http://www.codeproject.com/managedcpp/howtoc...

or reusing the VB6 MSComm ActiveX is easy, but it has some 'problems' (license)
http://www.devhood.com/tutorials/tutorial_details.aspx?tutor...
http://ourworld.compuserve.com/homepages/richard_grier/NETC...

commercial:
http://www.sax.net/dotnet/commu...

for Interop, use newsgroup:
microsoft.public.dotnet.framework.interop


--
NETMaster (Thomas Scheidegger)
http://www.cetus-links.org/oo_c...



"Tobin Titus" <tobin.nosp@mtitus.to> wrote in message news:bc9f01c2688a$0e61a110$37ef2ecf@TKMSFTNGXA13...
> Does anyone know if you can use Serial IO with C#? I have
> tried several things from using the System.IO.FileStream
> object to using plain old DllImport. The problem is that
> C# doesn't support bit fields. How do I pass a structure
> to an API call that requires a bit-field when C# doesn't
> support it.
> Is there another way to do this? Does anyone know? Is
> this the right group to talk to?