开发者

What is a Null value for a Long variable type in a Windows API call?

Stupid question. I thi开发者_JAVA百科nk this should be 0, but I can't seem to find it.

So, if I want to pass a Null value to a Windows API call (this happens to be in VB6), what value would I use? I think 0, but I guess it could be VBNull.


If the API argument is a LONG (and not, say, an LPVOID), try passing the zero long integer literal 0&.


Often this would be a null pointer and not a null value.

Then it depends on the Declare syntax actually used. If the declared argument was a ByRef ... As ... item then you'd say ByVal 0& (or sometimes vbNullString) in your call.

However if you declared pointers as ByVal ... As Long in the declaration (for use with VarPtr(), StrPtr(), etc.) simply using 0& in the call is what you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜