Re: endianess, float
From: Ulrich Korndoerfer (ulrich_wants_nospam_at_prosource.de)
Date: 09/14/04
- Next message: Wayne Ivory: "Re: Distinguishing Left and Right Clicks on a Popup Menu"
- Previous message: Ulrich Korndoerfer: "Re: naming issues"
- In reply to: Hanna-Barbera: "endianess, float"
- Next in thread: Mike D Sutton: "Re: endianess, float"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 14 Sep 2004 07:27:51 +0200
Hi Hanna-Barbera,
Hanna-Barbera wrote:
> ... I would like to switch endianess for a float (Single). I'm on x86 system
> obviously.
Why would you want to switch? Because of you got some data in a file
from a big endian system?
> I think that what needs to be done is that the hi order 16 bit needs to be
> swapped with the low order 16 bits.
No. You have to switch bytewise, no matter what data type.
> Is there a way to do this using only VB functions?
Yes.
> On some websites, people talked about a API function called CopyMemory to do
> this.Not sure in which DLL it is defined.
The dll is kernel32.dll. But beware, it's real name (as exported from
the dll) is RtlMoveMemory. CopyMemory is an alias name. Bruce McKinney
used to use (and named) it times ago. And, as he opened (one among the
first), VB programmer's eyes to the power of using API call's to utilize
pointer operations in VB (especially RtlMoveMemory), this alias he used
got stuck.
-- Ulrich Korndoerfer VB tips, helpers, solutions -> http://www.proSource.de/Downloads/
- Next message: Wayne Ivory: "Re: Distinguishing Left and Right Clicks on a Popup Menu"
- Previous message: Ulrich Korndoerfer: "Re: naming issues"
- In reply to: Hanna-Barbera: "endianess, float"
- Next in thread: Mike D Sutton: "Re: endianess, float"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|