Click to See Complete Forum and Search --> : How to open serial port in VB.NET 2003 with PPC
anrabi
July 23rd, 2005, 04:03 PM
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?
anrabi
August 14th, 2005, 02:28 PM
no one?
sashi1977
August 18th, 2005, 12:10 AM
no one?
i'm having the same problem. can anyone provide assistance regarding reading from Pocket PC serial port?
thanks
Sashi
kirants
August 18th, 2005, 04:16 PM
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/network/serialcommunications/article.php/c5395/
http://www.codeguru.com/Cpp/I-N/network/serialcommunications/article.php/c5425/
http://www.codeguru.com/Cpp/I-N/network/serialcommunications/article.php/c2483/
http://www.codeguru.com/Cpp/I-N/network/serialcommunications/article.php/c2503/
sashi1977
August 18th, 2005, 06:01 PM
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/network/serialcommunications/article.php/c5395/
http://www.codeguru.com/Cpp/I-N/network/serialcommunications/article.php/c5425/
http://www.codeguru.com/Cpp/I-N/network/serialcommunications/article.php/c2483/
http://www.codeguru.com/Cpp/I-N/network/serialcommunications/article.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
kirants
August 18th, 2005, 06:05 PM
Oops.. Missed that part.. Sorry, am not familiar with VB.net.
Did you try posting this question in the VB.Net forum of CG ?
anrabi
August 19th, 2005, 04:29 AM
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 ?
anrabi
August 30th, 2005, 07:36 PM
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.
kirants
August 30th, 2005, 07:41 PM
cool..:thumb:
Waiting for the day when programmers start talking about the same libraries and classes and methods across languages.. Hopefully, .Net succeeds in doing that
JJJJJ
September 15th, 2005, 12:21 AM
see this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/ReceivingSMSMessages.asp
may be help you
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.