   problem reading floats with directplay
  hi allI have a small problem usint directplay : i cant read floats, but it will work with intshere is the failing code case MessageType.Move:// handle the move internallyPlayerObject p = data.GetPlayer(e.Message.SenderID);p.x = (float) e.Message.ReceiveData.Read(System.Type.GetType("System.Float"));p.y = (float) e.Message.ReceiveData.Read(System.Type.GetType("System.Float"));it fails on the first Read call, and says System.NullReferenceExceptionof course, i'm sending floats on the other end, and p.x is floatIf i send ints and try to read System.Int32, it works fineany ideas? thx[edited by - brann on March 23, 2004 8:26:26 AM]
  Check this thread.   Muhammad HaggagBitwise account: MHaggag - ;  i''ve just tried his solution, but it says me the struct cannot be "blitted".i''ve tried this to read: p.x = (float) e.Message.ReceiveData.Read(typeof(float));it doesnt fail anymore, but the value i get is totally wrong (i''m sending 0 and getting a random value) 