JOCHEN and MABDELOUAHAB,
I'm reading through the
MASM Programmer's Guide, Version 6.1, 1992, Chapter 9 Using Macros, starts on page 176. I'm a COMPLETE IMBECILE when it comes to understanding macros.

...But, I'm making progress,...I have a much better concept of what the BSTR$ Macro is actually supposed to be doing,...although I'm still kinda hazy on the specifics,...

I also set up a new MASM project that just contains the simplest possible configuration for creating a Windows program. Then, I included the two MASMRef include files: ComHelper.inc and DotNetHelper.inc. I tried to compile this project, and got many errors,...all of the same type (error A2085: instruction or register not accepted in current CPU mode.). By reading the error descriptions carefully, I discovered that I could comment out only three lines of the BSTR$ macro (in ComHelper.inc), and the whole project compiled without any errors. I haven't tried to invoke any of the methods, yet,...to test if the BSTR$ macro will actually work (I'm assuming that it won't work correctly).
Here is the BSTR$ Macro with the three lines that I commented out (this is the original version, by the way):
BSTR$ MACRO qstr:vararg
LOCAL arg,qot,q,bstrLbl,bstr_Seg,FrstL,tmpLen,cur_Pos,tmpStr,cur_tPos
cs_Seg catstr @CurSeg
ifidn cs_Seg, <CONST>
bstr_Seg TEXTEQU <.const>
elseifidn cs_Seg, <_BSS>
bstr_Seg TEXTEQU <.data?>
elseifidn cs_Seg, <_DATA>
bstr_Seg TEXTEQU <.data>
elseifidn cs_Seg, <_TEXT>
bstr_Seg TEXTEQU <.code>
endif
; .data
; dd _LenBSTR(qstr)
FrstL = 0
FOR arg,<qstr>
tmpStr equ <>
qot SubStr <arg>,1,1
IFIDNI qot,<!'>
tmpLen = @SizeStr(<arg>)
tmpLen = tmpLen - 2
cur_Pos = 1
cur_tPos = 0
repeat tmpLen
cur_Pos=cur_Pos+1
cur_tPos=cur_tPos+1
ch_unq SubStr <arg>,cur_Pos,1
IF cur_Pos eq 2
tmpStr CATSTR tmpStr,<!">,ch_unq,<!">
ELSE
IF cur_tPos eq 1
tmpStr CATSTR tmpStr,<!">,ch_unq,<!">
ELSE
tmpStr CATSTR tmpStr,<!,">,ch_unq,<!">
ENDIF
ENDIF
IF cur_tPos eq 15
IF FrstL eq 0
bstrLbl dw tmpStr
FrstL = 1
ELSE
dw tmpStr
ENDIF
cur_tPos = 0
tmpStr CATSTR <>
ENDIF
endm
IF tmpLen ne 0
IF cur_tPos ne 0
IF FrstL eq 0
bstrLbl dw tmpStr
FrstL = 1
ELSE
dw tmpStr
ENDIF
ENDIF
ENDIF
ELSEIFIDNI qot,<!">
tmpLen = @SizeStr(<arg>)
tmpLen = tmpLen - 2
cur_Pos = 1
cur_tPos = 0
repeat tmpLen
cur_Pos=cur_Pos+1
cur_tPos=cur_tPos+1
ch_unq SubStr <arg>,cur_Pos,1
IF (cur_Pos eq 2)
tmpStr CATSTR tmpStr,<!">,ch_unq,<!">
ELSE
IF (cur_tPos eq 1)
tmpStr CATSTR tmpStr,<!">,ch_unq,<!">
ELSE
tmpStr CATSTR tmpStr,<!,">,ch_unq,<!">
ENDIF
ENDIF
IF cur_tPos eq 15
IF FrstL eq 0
bstrLbl dw tmpStr
FrstL = 1
ELSE
dw tmpStr
ENDIF
cur_tPos = 0
tmpStr CATSTR <>
ENDIF
endm
IF tmpLen ne 0
IF cur_tPos ne 0
IF FrstL eq 0
bstrLbl dw tmpStr
FrstL = 1
ELSE
dw tmpStr
ENDIF
ENDIF
ENDIF
ELSE
IF FrstL eq 0
bstrLbl dw arg
FrstL = 1
ELSE
dw arg
ENDIF
ENDIF
ENDM
IF FrstL eq 0
bstrLbl dw 0
ELSE
dw 0
ENDIF
; bstr_Seg
EXITM <OFFSET bstrLbl>
ENDM
So, the lines 13 and 14, which look like this:
; .data
; dd _LenBSTR(qstr)...And, the next to last line of the macro:
; bstr_Seg...I have no idea what that .data line is doing, and, I have no idea what the bstr_Seg line is doing,...
