REAL4 convertion with OLE automation API

Started by Vortex, January 31, 2026, 05:46:37 PM

Previous topic - Next topic

Vortex

Inspired by Jochen's thread in the Masm Forum ( http://masm32.com/board/index.php?topic=13156.0 ) , here ıs a REAL4 to string convertion example with VarBstrFromR4 :

include    VarBstrFromR4.inc

.data

f          REAL4 3.14

.data?

output      dd ?
buffer      db 8 dup(?)

.code

start:

    invoke  VarBstrFromR4,f,0,0,ADDR output

    xor    eax,eax
    invoke  WideCharToMultiByte,CP_ACP,eax,\
            output,-1,ADDR buffer,\
            8,eax,eax

    invoke  StdOut,ADDR buffer

    invoke  SysFreeString,output

    invoke  ExitProcess,0
.
.
Code it... That's all...