CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2005
    Posts
    4

    How to open serial port in VB.NET 2003 with PPC

    Hi ALL, I tried to look for it in the forum but the only part discussing this is in VC with the "CreateFile" call.

    I have a pocket PC with Windows Mobile 2003 installed, and Visual Studio .NET 2003.

    I am trying to communicate with the GPS (which comes build in in the handled pc on com2). I understand what I need to read and parse from the GPS com port in order to build simple GPS application, BUT can't tell how to read from the serial port.

    Can anyone provide me a sample code which uses to open serial port, read from it (maybe using a timer?) and close it?

  2. #2
    Join Date
    Jul 2005
    Posts
    4

    Re: How to open serial port in VB.NET 2003 with PPC

    no one?

  3. #3
    Join Date
    Aug 2005
    Posts
    4

    Re: How to open serial port in VB.NET 2003 with PPC

    Quote Originally Posted by anrabi
    no one?
    i'm having the same problem. can anyone provide assistance regarding reading from Pocket PC serial port?

    thanks
    Sashi

  4. #4
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: How to open serial port in VB.NET 2003 with PPC

    It's pretty much similar to what you do on desktops. The key APIs are
    CreateFile
    ReadFile
    WriteFile
    SetCommMask
    SetCommState

    Here are some articles.
    http://www.codeguru.com/Cpp/I-N/netw...cle.php/c5395/
    http://www.codeguru.com/Cpp/I-N/netw...cle.php/c5425/
    http://www.codeguru.com/Cpp/I-N/netw...cle.php/c2483/
    http://www.codeguru.com/Cpp/I-N/netw...cle.php/c2503/

  5. #5
    Join Date
    Aug 2005
    Posts
    4

    Re: How to open serial port in VB.NET 2003 with PPC

    Quote Originally Posted by kirants
    It's pretty much similar to what you do on desktops. The key APIs are
    CreateFile
    ReadFile
    WriteFile
    SetCommMask
    SetCommState

    Here are some articles.
    http://www.codeguru.com/Cpp/I-N/netw...cle.php/c5395/
    http://www.codeguru.com/Cpp/I-N/netw...cle.php/c5425/
    http://www.codeguru.com/Cpp/I-N/netw...cle.php/c2483/
    http://www.codeguru.com/Cpp/I-N/netw...cle.php/c2503/
    thanks kirants.

    but all the articles talk about VC++. Isn't there a simple VB.NET sample regarding this?

    Thanks again, though.

    SASHI

  6. #6
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: How to open serial port in VB.NET 2003 with PPC

    Oops.. Missed that part.. Sorry, am not familiar with VB.net.

    Did you try posting this question in the VB.Net forum of CG ?

  7. #7
    Join Date
    Jul 2005
    Posts
    4

    Re: How to open serial port in VB.NET 2003 with PPC

    shashi - maybe we need to write VC.NET DLL and use it in VB.NET .. ?
    The thing is I need it at CF.

    Can someone guide me how to write this DLL ?

  8. #8
    Join Date
    Jul 2005
    Posts
    4

    Re: How to open serial port in VB.NET 2003 with PPC

    ok.. i built DLL for serial communication in VB :
    1. I copied some VC code from the exaples given here bykirants.
    2. Some minor changes been done in the constructor of the class to meet my needs.
    3. The project was a VC class library which generates DLL. I needed also SerialNET DLL as a reference in the VB program.
    4. There is some kind of a problem when referncing your own DLL. It is related to the mscorlib dll key or something. Anyway - you can change the refernce order (bring mscorlib to be first refernce) using notepad in your vb project dir.
    5. It works just fine!

    Although I did not get answer to a solution in VB, I want to thank you.

    BST RGRD, Anrabi.

  9. #9
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: How to open serial port in VB.NET 2003 with PPC

    cool..

    Waiting for the day when programmers start talking about the same libraries and classes and methods across languages.. Hopefully, .Net succeeds in doing that

  10. #10
    Join Date
    Sep 2005
    Posts
    1

    Re: How to open serial port in VB.NET 2003 with PPC


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured