Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem using Windows headers
#1
Windows headers have a lot of function parameters like this:

lpEventAttributes As SECURITY_ATTRIBUTES

That's the reference to an UDT called SECURITY_ATTRIBUTES. But Windows allows also the passing of a null pointer, meaning the feature is not used.

How can I pass this null pointer wihout FB complaining about "Type mismatch at parameter n"?
Antoni
Reply
#2
Use a byval pointer instead of byref, then FB will let you pass 0.
Reply
#3
So you recommend me to modify my copy of Kernel32.bi...I would prefer to use the copy everyone uses. Other ideas?

EDITED:
I tried to re-define the parameter in kernel32.bi as
byval lpEventAttributes As SECURITY_ATTRIBUTES
and i got an "Illegal Specification at parameter n" error
Antoni
Reply
#4
He meant, if it's a byref argument (not a string), you can do as in VB:

Code:
proc( byval 0, ... )
Reply
#5
Thanks Sterling, V1ctor. It works, of course..
I did'nt know byval could be used in the call to a function!
Antoni
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)