News:

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

OPENFILENAME

Started by DC, November 23, 2005, 07:25:54 AM

Previous topic - Next topic

DC

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
this isn't daja vu, I'm just learning it for the 37th time
http://www.bmath.net

u

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>

Please use a smaller graphic in your signature.

Tedd

..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.)
No snowflake in an avalanche feels responsible.

u

>> "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.
Please use a smaller graphic in your signature.

DC

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
this isn't daja vu, I'm just learning it for the 37th time
http://www.bmath.net