When declaring functions in external DLLs (in this case the Win API) using the DECLARE statement, is it required that
I spell out the parameter passing function or can I leave the parameter list 'generic' and use BYVAL/BYREF when I
actually call the function? IOW, can my declare be:
Declare SomeSub Lib "External.Dll" (Param1 as DWord, Param2 as Long, Param3 as SomeUDT)
and then in code:
SomeSub BYVAL Param1, BYREF Param2, BYREF Param3 ' UDTs can only be passed BYREF
Granted, it's cleaner syntax to define the passing method in the DECLARE, but when debugging it's easier to just change
the actual call.
Sorry if this is covered in the docs, but I spent the afternoon trying to get a <expletive deleted> WinAPI function to
work right, without much success. It's still bugging me, so I thought I'd post from home in the hope that
I'll forget about it and not have any API nightmares.
Thanks!
------------------
Mark Newman
I spell out the parameter passing function or can I leave the parameter list 'generic' and use BYVAL/BYREF when I
actually call the function? IOW, can my declare be:
Declare SomeSub Lib "External.Dll" (Param1 as DWord, Param2 as Long, Param3 as SomeUDT)
and then in code:
SomeSub BYVAL Param1, BYREF Param2, BYREF Param3 ' UDTs can only be passed BYREF
Granted, it's cleaner syntax to define the passing method in the DECLARE, but when debugging it's easier to just change
the actual call.
Sorry if this is covered in the docs, but I spent the afternoon trying to get a <expletive deleted> WinAPI function to
work right, without much success. It's still bugging me, so I thought I'd post from home in the hope that
I'll forget about it and not have any API nightmares.

Thanks!
------------------
Mark Newman
Comment