Adding hDC to a custom control
I'm trying to add the hDC attribute onto a custom picturebox control so I can use bitblt with it.
This picturebox works perfectly fine, here's what I'm using for the hDC code.
==================================
==================================
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Public Property Let WritehDC(hDestDC1 As Long, X1 As Long, Y1 As Long, nWidth1 As Long, nHeight1 As Long, hSrcDC1 As Long, xSrc As Long, ySrc As Long, dwRop1 As Long)
BitBlt PctBackground.hDC, X1, Y1, nWidth1, nHeight1, hSrcDC1, xsrc1, ysrc1, dwRop1
End Property
==================================
==================================
When I try to use the WritehDC command in a form, it says "Invalid Use of Property." Can anyone help me out here?
Re: Adding hDC to a custom control
And as a note: I have read through the adding properties section of the FAQ. When trying to declare this an editable property I get back the message "Definitions of property procedures for the same property are inconsistent, or property procedure has an optional parameter, a ParamArray, or an invalid Set final perameter" while using the "Public property set" command, and the previous error with the 'public property "let" command.
Re: Adding hDC to a custom control
Where is the value argument of the property? Can you write how this call is done? Is it necessary to use a property for this call?
Re: Adding hDC to a custom control
What is the code for your Get/Let Properties?
Re: Adding hDC to a custom control
. . . and don't forget that any reference must to hDC must be in process. You can, for instance run two seperate VB IDE's and get them to communicate; but if you need in-process references (Windows pointers like hDC are one example) you must do your testing in a VB group.