Re: URGENT: Unix/Windows Struct cast problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Stu Smith (stuarts_at_nospam-digita.com)
Date: 07/29/04


Date: Thu, 29 Jul 2004 10:09:01 +0100


"cody" <no_spam_deutronium@gmx.net> wrote in message
news:upTCtyTdEHA.3928@TK2MSFTNGP09.phx.gbl...
> You have a field of type uint in your struct. Maybe it is 32bit on windows
> but it is 64 on sun, that could be the problem.

And don't Suns have a different endianess to x86?

>
> --
> cody
>
> Freeware Tools, Games and Humour
> http://www.deutronium.de.vu || http://www.deutronium.tk
> "Tamir Khason" <tamir-NOSPAM@tcon-NOSPAM.co.il> schrieb im Newsbeitrag
> news:uv0iBrLdEHA.3944@tk2msftngp13.phx.gbl...
> > Thank you for response.
> > 1) The source server was Sun (not Linux)
> > 2) no, the client is C# and I'm cast Object (created from Byte[]) to
> struct
> > 3) No problem, it works with Sun server, but I think does not with
Windows
> > server
> >
> > --
> > Tamir Khason
> > You want dot.NET? Just ask:
> > "Please, www.dotnet.us "
> >
> > "BMermuys" <someone@someone.com> wrote in message
> > news:vPPNc.197203$d47.10114143@phobos.telenet-ops.be...
> > > Hi,
> > >
> > > "Tamir Khason" <tamir-NOSPAM@tcon-NOSPAM.co.il> wrote in message
> > > news:uuM5ffLdEHA.3572@TK2MSFTNGP10.phx.gbl...
> > > > The problem is WHAT I'M passing in.
> > > > I revieve the stream from C++ server.
> > > > When it was in UNIX enviroment - everything worked ok, but once they
> > > > treanfer to Windows the problem begun. There are same structures,
but
> as
> > > far
> > > > as I understand , not the same stream - thet's the single
explanation
> I
> > > can
> > > > think about...
> > >
> > > So, if you only see this problem when the server is on Windows and not
> on
> > > Linux, you can agree that the problem is with the server and not the
> > client.
> > >
> > > Can't you post some code, how do you transmit this struct in c++, do
you
> > > cast the struct* to a byte* ?
> > >
> > > I still don't quite understand what the problem is you're having if
> > > PtrToStruct works.
> > >
> > > HTH,
> > > greetings
> > >
> > >
> > > >
> > > > --
> > > > Tamir Khason
> > > > You want dot.NET? Just ask:
> > > > "Please, www.dotnet.us "
> > > >
> > > > "cody" <no_spam_deutronium@gmx.net> wrote in message
> > > > news:uEtZ649cEHA.3620@TK2MSFTNGP10.phx.gbl...
> > > > > > Anyway there is no way to provide full source it a lot of
classes
> > with
> > > > > > relations etc.
> > > > > > The point is that there are diferences between unix and windows
> TCP
> > or
> > > > > > binary stream....
> > > > >
> > > > >
> > > > > I do not believe that. The bytes can be read from the stream the
> same
> > > way
> > > > > you put them in.
> > > > > The marshaller will take care that the byte order (big
endian/little
> > > > endian)
> > > > > in your struct's variables will be ok.
> > > > >
> > > > > Remember that you have to pass the correct type to PtrToStruct,
> > > otherwise
> > > > > itt will output the wrong type.
> > > > >
> > > > > --
> > > > > cody
> > > > >
> > > > > Freeware Tools, Games and Humour
> > > > > http://www.deutronium.de.vu || http://www.deutronium.tk
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Relevant Pages