News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Data types for masm from c++

Started by ecube, March 05, 2008, 01:26:23 PM

Previous topic - Next topic

ecube

anyone know a good place I can find a list of data types from c++ to masm? for instance what wchar would be in masm?

ToutEnMasm


I am not sure to understand well what you need but see
http://www.masm32.com/board/index.php?topic=5428.msg40500#msg40500
All commons are translate in the zip files,see egales.txt

hutch--

Cube,

WCHAR is a 2 byte character, a pointer to it is a 32 bit unsigned value like normal. Generally you allocate 2 bytes for each character in a unicode string (WCHAR) so if you have a 64 character long string INCLUDING the terminator you allocate 128 bytes to put it into.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

thomas_remkus

I think of data less like types of data and more like the size that they occupy. So a DWORD is a DWORD. A CHAR is a BYTE and WCHAR is a WORD. A pointer of any kind is a DWORD in reality (32-bit protected mode). Other types that are like structs are basically the same thing here. You can create unions if you need.

Let's say you were looking for an RBG value. That's really just 4 BYTES which is really just a DWORD. You can reference it either way.

herge


Hi Hutch:

If you have 64 unicoide characters whuch is 128 bytes the terminating
Zero will Not be in the 128 byte buffer.
// Herge born  Brussels, Belgium May 22, 1907
// Died March 3, 1983
// Cartoonist of Tintin and Snowy

thomas_remkus

I'm not Hutch, but I believe that the null terminator of 128 BYTES in unicode will be in the 127th and 128th bytes (offset 126 and 127). You might check by 64 word offsets as well for the terminator.

hutch--

 :bg

herge,

Quote
If you have 64 unicoide characters whuch is 128 bytes the terminating
Zero will Not be in the 128 byte buffer.

You did not read my posting properly.

Quote
so if you have a 64 character long string INCLUDING the terminator

Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php