Results 1 to 5 of 5

Thread: Adding hDC to a custom control

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    2

    Question 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?

  2. #2

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    2

    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.

  3. #3
    Lively Member
    Join Date
    Nov 2005
    Posts
    68

    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?
    "bla, bla,... exists number M so for each n > M bla, bla..." Exists? Where is it? (Kronecker said...)

  4. #4
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: Adding hDC to a custom control

    What is the code for your Get/Let Properties?
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  5. #5
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253

    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.
    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width