lpOFN OPENFILENAME <sizeof OPENFILENAME, NULL, NULL, NULL, NULL, NULL, NULL, addr lpBufTo, 1000, \
NULL, NULL, addr lpCurDir, addr lpGetDir, NULL, 0, 0, NULL, NULL, NULL, NULL>
the above code is giving me an "extra characters" error, I checked with the struct and there are 20 members there and here,
if I use less here I still get the same error.
what am I doing wrong?
I want to retrieve just a dir with no file name.
thanx DC
should not use "addr"
lpOFN OPENFILENAME <sizeof OPENFILENAME, NULL, NULL, NULL, NULL, NULL, NULL,lpBufTo, 1000, \
NULL, NULL, lpCurDir,lpGetDir, NULL, 0, 0, NULL, NULL, NULL, NULL>
..assuming that "lpBufTo", "lpCurDir", and "lpGetDir" are all already pointers (the addresses of these things) - which their names imply.
If they're not, they should be, so you'll have to use OFFSET instead of ADDR (and it would be a good idea to remove "lp-" from their names.)
>> "so you'll have to use OFFSET instead of ADDR"
You don't need to use "offset" in compile-time structure initialization.
Compile-time structure initialization cannot get the value of some .data or .code member - it knows only the offset, then the linker replaces that offset with the "real" address. Thus, it is irrelevant to MASM whether you mention "offset" or not.
thanx guys,
that's the first time I ever tried .data initialization, I don't know why I've had such a hard time knowing when to use addr, offset, and ptr, it's slowly sinking in.
thanx again,
DC