I am reading some VB6 to convert to C#. What does this line mean? Is 0& equivalent to IntPtr.Zero?
//'Get a Device context
hdc = GetDC(0&)
This value is used to pinvoke, so I’m not sure IntPtr.Zero makes sense since we need to be selecting some object.
OldFont = SelectObject(hdc, ObjFont)
Note, ObjFont is populated via
//'Get the Window's font
ObjFont = SendMessage(hwnd, WM_GETFONT, 0, 0&)//there's that mysterious 0& agaain.
It is a (VB6) type declaration character. Have a look at this question for more details on these.
In your example VB6 code it is forcing
0to be aLong(4 bytes) as it would otherwise be anInteger(2 bytes)It is the same as doing this long hand approach again VB6 code: