Re: endianess, float

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

From: Ulrich Korndoerfer (ulrich_wants_nospam_at_prosource.de)
Date: 09/14/04


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/


Relevant Pages

  • Re: Fringe - Stowaway - Spoilers
    ... You fail to explain how the switch happened in the first ... Broyles from our dimension went through the same implanted memories ... that it refers to either Alias or Lost. ...
    (rec.arts.sf.tv)
  • Re: Pirated XP, means-test everyone and every product with "income
    ... | Alias, you are needlessly confrontational, but you have a good point -- ... The license idea is a scam. ... Yeah, bait and switch. ...
    (microsoft.public.windowsxp.general)
  • Re: subroutines as separate files
    ... switch" applied in the broad sense Giles is implying. ... > whether a static library or a dll is used. ... > (push arguments to the stack, push required registers to stack, execute ... or you incur overhead by calling so-called trampoline ...
    (comp.lang.fortran)
  • Re: disaster recovery - did I do the right thing?
    ... What I did was to start over, reinstall from scratch. ... Unfortunately, the OP explicitly used the -f switch, so the alias ...
    (freebsd-questions)
  • Re: get .dll from .lib
    ... C# and Python can't handle .lib files? ... a basic DLL is simple enough to create. ... BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. ... function then compile it by passing the proper DLL switch to the ...
    (alt.lang.asm)