Opened 8 years ago

Closed 23 months ago

#3213 closed defect (invalid)

Is wxDataInputStream::Write32() bugged?

Reported by: schenkos Owned by:
Priority: normal Milestone:
Component: wxMSW Version:
Keywords: Cc: schenkos
Blocked By: Blocking:
Patch: no

Description

I've compiled wxWidgets 2.6.3 with mingw (gcc3.4.4)
under Windows XP. I've enabled unicode support.

When I run the following code, "i" returns 4251649
instead of 1:

wxString msg = _T("");
wxStringOutputStream sos(&msg);
wxDataOutputStream os(sos);
os.BigEndianOrdered(false);
wxUint32 i = 1;
os.Write32(i);
wxMessageBox(wxString::Format(_T("%u:%u:%u:%u"),

msg.c_str()[0], msg.c_str()[1], msg.c_str()[2],
msg.c_str()[3]), _("Result"));

wxStringInputStream sis(msg);
wxDataInputStream is(sis);
is.BigEndianOrdered(false);
i = is.Read32();
wxMessageBox(wxString::Format(_T("%u"), i),

_("Result"));

Am I wrong or not?

Thank you in advance!

Change History (3)

comment:1 Changed 8 years ago by schenkos

sis.GetSize() returns 0 instead of 4.
Maybe it can help you.

comment:2 Changed 23 months ago by oneeyeman

Just tested the provided code on Windows 7 64-bit + MSVC 2010.

I got 1:0:0:0 and 1.

This can be fixed.

comment:3 Changed 23 months ago by vadz

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.