'print' macro and what do the typical prefixes 'sz' and 'lp'

Started by p0wder, July 07, 2006, 09:03:00 PM

Previous topic - Next topic

p0wder

I have a macro defined right below my include files and libraries. here is the macro:

print macro lpszText:VARARG
local txt
.data
  txt db lpszText,13,10,0
.code
  invoke StdOut,addr txt
ENDM


I am calling it like this:

print "testing the macro ..."

Why do i get the following errors:

error A2006: undefined symbol : StdOut
print(5): Macro Called From Main Line Code


Also, I am looking at other applications source code, and i see a lot of variables prefixed with 'sz' and 'lp' - what do they mean?

Regards.

Casper

p0wder,
In order to use StdOut you need to declare the following two lines before the macro:

include masm32.inc
includelib masm32.lib

If you are using hard coded paths, then use:

include \masm32\include\masm32.inc
includelib \masm32\lib\masm32.lib

hth,
Casper

Ossa

Not that it's related to your problem, but "sz" means "String: Zero terminated" and "lp" means "Long Pointer".

[edit] See Hungarian Notation [/edit]

Ossa
Website (very old): ossa.the-wot.co.uk

Mark Jones

"sz" and "lp" are from the C language. They mean about the same thing in MASM. Since lots of people know C and only a few know ASM, they are typically used in ASM (but not a requirement.) Use whatever identifier you feel comfortable with. I like to prefix a letter or two to every handle indicating what it is; i.e., nCount = number of counts, bFlag = boolean (yes/no) flag, sz/lpString = zero-terminated string, hBuffer = handle to buffer, etc. The differences in which all these are used is explained in the masm32\help\asmintro.hlp file.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08