News:

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

Help in declaring GUID in MASM

Started by gwapo, March 27, 2006, 06:12:46 AM

Previous topic - Next topic

gwapo

I'm stuck on declaring a GUID in MASM.

I have this RecordSet CLSID "{00000556-0000-0010-8000-00AA006D2EA4}" to create an instance of a RecordSet object using ActiveX Data Object COM library, using MASM.


_RecordSet GUID <00000556h, 0000h, 0010h, 80h, 00h, 00h, AAh, 00h, 6Dh, 2Eh, 0A4h>


The above declaration seems right, but MASM throws an error upon link:
"initializer must be a string or single item"


Thanks for you help,

-chris

MichaelW

In his examples Ernest Murphy does it like this:

s_RecordSet TEXTEQU <{00000556h, 0000h, 0010h, \
                    {80h, 00h, 00h, 0AAh, 00h, 6Dh, 2Eh, 0A4h}}>
_RecordSet GUID s_RecordSet


I'm not sure why you cannot initialize the structure directly.



eschew obfuscation

zooba

I think it's because the sequence of 8 bytes is defined using a DUP which seems to create it as a nested structure. I think you can nest angle brackets as well as braces.

Cheers,

Zooba :U

Mark Jones

Quote from: gwapo on March 27, 2006, 06:12:46 AM
I'm stuck on declaring a GUID in MASM:

_RecordSet GUID <00000556h, 0000h, 0010h, 80h, 00h, 00h, AAh, 00h, 6Dh, 2Eh, 0A4h>

The above declaration seems right, but MASM throws an error upon link: "initializer must be a string or single item"

I think it may be getting stuck on AAh and assuming it is a variable or something. Try sticking a zero in front of it; 0AAh
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

gwapo

Mark,
Sorry, it's a typo, it's actually:



_RecordSet GUID <00000556h, 0000h, 0010h, 80h, 00h, 00h, 0AAh, 00h, 6Dh, 2Eh, 0A4h>



But it still receiving "initializer must be a string or single item" error.


MichaelW,
Thanks, adding curly braces has solved the problem. I'll try working on this GUID:



_RecordSet GUID <00000556h, 0000h, 0010h, {80h, 00h, 00h, 0AAh, 00h, 6Dh, 2Eh, 0A4h}>




zooba,
I tried it using <> as you suggested, and it worked like the curly braces:


_RecordSet GUID <00000556h, 0000h, 0010h, <80h, 00h, 00h, 0AAh, 00h, 6Dh, 2Eh, 0A4h>>



Probably it means, we can use curly braces as an alternative to <> in MASM:



_RecordSet GUID {00000556h, 0000h, 0010h, {80h, 00h, 00h, 0AAh, 00h, 6Dh, 2Eh, 0A4h}}



Thanks,

-chris