473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

WaitCommEvent() on PDA using GPS-device

Hey,

I'm writing a program which will run on a PDA equipped with a GPS link.
I'm trying to read data from the GPS-device, but so far I've been out of
luck..

(OS: Windows CE - coding language: C# - GPS device: HI-303MMF - PDA:
COMPAQ iPAQ)

The GPS device uses a COM port of the PDA. This should be similar to
writing software for a normal COM-device on q desktop-pc.

Everything goes right up untill I use this function:

WaitCommEvent(uHandle, uMask, uOverlapped);

This function should normally wait untill data can be read from the
device. Unfortunalty, the function returns false. (failure)

According to GetLastError() the device handler (uHandle) is corrupt but
when debugging I can clearly see that my device handler _is_ set after
"CreateFile(cs.port, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);"

I'm a newbie at this level of programming and totally out of options.

Did anybody have the same problem, or any clue as to what might have
gone wrong ?

I checked the BaudRate, Data bit, Parity.. etc of the connection, and
those all seem to be in order..

Thanks a lot for any assistance,

Luk Vloemans
IT student

Nov 15 '05 #1
2 3074
Hey,

I found the solution to my problem. If anyone has a similar problem, you
should always use your original file handler, returned by CreateFile().

special thanks to Mattias Sjögren.

grtz,

Luk Vloemans



Luk Vloemans wrote:
Hey,

I'm writing a program which will run on a PDA equipped with a GPS link.
I'm trying to read data from the GPS-device, but so far I've been out of
luck..

(OS: Windows CE - coding language: C# - GPS device: HI-303MMF - PDA:
COMPAQ iPAQ)

The GPS device uses a COM port of the PDA. This should be similar to
writing software for a normal COM-device on q desktop-pc.

Everything goes right up untill I use this function:

WaitCommEvent(uHandle, uMask, uOverlapped);

This function should normally wait untill data can be read from the
device. Unfortunalty, the function returns false. (failure)

According to GetLastError() the device handler (uHandle) is corrupt but
when debugging I can clearly see that my device handler _is_ set after
"CreateFile(cs.port, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);"

I'm a newbie at this level of programming and totally out of options.

Did anybody have the same problem, or any clue as to what might have
gone wrong ?

I checked the BaudRate, Data bit, Parity.. etc of the connection, and
those all seem to be in order..

Thanks a lot for any assistance,

Luk Vloemans
IT student


Nov 15 '05 #2
Sounds interesting, this program. Any possabilities to get information about
the progress?

/Martin

"Luk Vloemans" <lu**********@student.luc.ac.be> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hey,

I'm writing a program which will run on a PDA equipped with a GPS link.
I'm trying to read data from the GPS-device, but so far I've been out of
luck..

(OS: Windows CE - coding language: C# - GPS device: HI-303MMF - PDA:
COMPAQ iPAQ)

The GPS device uses a COM port of the PDA. This should be similar to
writing software for a normal COM-device on q desktop-pc.

Everything goes right up untill I use this function:

WaitCommEvent(uHandle, uMask, uOverlapped);

This function should normally wait untill data can be read from the
device. Unfortunalty, the function returns false. (failure)

According to GetLastError() the device handler (uHandle) is corrupt but
when debugging I can clearly see that my device handler _is_ set after
"CreateFile(cs.port, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);"

I'm a newbie at this level of programming and totally out of options.

Did anybody have the same problem, or any clue as to what might have
gone wrong ?

I checked the BaudRate, Data bit, Parity.. etc of the connection, and
those all seem to be in order..

Thanks a lot for any assistance,

Luk Vloemans
IT student

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jim | last post by:
Hi, All I am using python (activestate 2.2.2-224) on XP home and have suddenly got the following error from a file which worked fine under millenium. File...
0
by: jim | last post by:
Hi, All I am using python (activestate 2.2.2-224) on XP home and have suddenly got the following error from a file which works fine under millenium. File...
0
by: jim | last post by:
Hi, All I am using python (activestate 2.2.2-224) on XP home and have suddenly got the following error from a file which worked fine under millenium. self.Overlapped = win32file.OVERLAPPED()...
2
by: Torre Quinn | last post by:
I am not even sure what group to ask this question so forgive me if this is not the correct forum. I am really just starting my research on this subject so pardon me if they are "green". I am...
12
by: craigkenisston | last post by:
Hi, I will use an example to do a simplified description of my problem, please don't laugh. I just "believe" I would have to use either interface or abstract classes, but I've not ever write an...
1
by: basyarie | last post by:
Hello All, I`d like to introduce myself. I`m basyarie, now is student of university. Nice to meet you all. I`m beginner in this discussion community. Just want to ask about VB6 for GPS...
13
by: volosov | last post by:
I would really appreciate if someone could give me a hint how these floats are encoded: 0B7D2F70 41.8713 0B7D232F 41.8687 0B7D220F 41.8684 Thanks in advance Vadim
14
by: ashore | last post by:
Folks, I'm looking to send some coords data to a GPS unit. Any hints on how to do that will be mucho appreciado. Info on addressing as well as data formats, ... ? I want to embed this...
3
by: Arepi | last post by:
Hi! How can I use WaitCommEvent (for COM PORT ) in Perl ? (I downloaded the Win32-SerialPort-0.19 modul from cpan but nothing) Thanks!
2
by: Destiny111 | last post by:
Hi! I have a gps program which works only when the "manage gps automatically" function is checked in the PDA settings. I do not want to enable user to disable my gps coords logging by uncheck...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.