Hi there,
Getting 0 back in this code:
Where newHdc is passed as the dc property of a formObj in the loading phase- but not yet shown.
Fairly sure that GetDC and ReleaseDC is not required for this use, but what's found in testing is this:
DCWidth (or DCHeight) will return values if the dimensions of the form are not changed. Haven't tested other properties being changed.
If the formObj width or height is changed before another call of GetDeviceCaps, DCWidth (or DCHeight) will then return 0.
Not a big drama, any corrections welcome- but it's out there if anyone is interested. :)
Getting 0 back in this code:
Code:
Public Property Let hDC(newHdc As Long)
HDCStored = newHdc
End Property
Code:
Public Property Get DCWidth() As Long
DCWidth = GetDeviceCaps(HDCStored, HORZRES)
End Property
DCWidth (or DCHeight) will return values if the dimensions of the form are not changed. Haven't tested other properties being changed.
If the formObj width or height is changed before another call of GetDeviceCaps, DCWidth (or DCHeight) will then return 0.
Not a big drama, any corrections welcome- but it's out there if anyone is interested. :)