View Single Post
  #15   Spotlight this post!  
Unread 02-01-2007, 12:55
esquared's Avatar
esquared esquared is offline
Keeps saying 3-2-1-Rush...
AKA: Angry Eric
no team (Volunteer!)
Team Role: Mascot
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Boston, MA
Posts: 192
esquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond repute
Re: Visual C++ 2005 Designer

Quote:
Originally Posted by Bob22341 View Post
Try adding brackets after your while statement. This is probably your problem because your while statement isn't doing anything right now.

ex:

for(){
while(){
arguments
}
}
That while loop is waiting until there is at least 1 byte received, then it fails the conditional and packs the two bytes into a 16 bit variable. It's just a "smart" waiting function.

Although on further inspection it might be a good idea to ensure the while loop waits to get 2 bytes instead of just 1, since you end up using 2 bytes of data. That way you don't accidentally skip a byte if you ReadByte() twice before the second byte you assume is there hasn't shown up. Thats the fun of events that are asynchronous