Results 1 to 7 of 7

Thread: Vc6++ Help Meeeeeeeeeee

  1. #1
    Zac
    Zac is offline
    Constant Bitrate
    Join Date
    Feb 2004
    Location
    VA
    Posts
    192

    Vc6++ Help Meeeeeeeeeee

    Blah going from libSDL for graphics and windows to window's stuff isn't fun...I started work on the interface for my relay controller and I'm having problems getting it do what I want.

    The app is just a dialog that shows all of the buttons to control the relays and crap...The buttons are a custom class based off of CStatic to use bitmaps. The program class is based off CDialog.

    I need my program class to be able to know when the user has released the mouse button (so it can turn the relay off.) My button class gets told when the button is up using OnLButtonUp and updates the button's bitmap fine...any idea why my main class won't recongnize the same?

    edit: Basically I see that when the cursor is in my static img all events go to it and nothing gets to the dialog class...can I just tell them to share with eachother and stop ****ing me off? :-P

  2. #2
    FLAC IntellaWorks's Avatar
    Join Date
    Jun 2004
    Location
    NH
    Posts
    1,173

    .

    Post your code.
    Progress [I will seriously never be done!]
    Via EPIA MII
    512MB RAM
    OEM GPS (embedded)
    nLite WinXP pro on
    1GB Extreme III CF card
    Carnetix 1260 startup/ DC-DC regulator
    Software: Still, re-Writing my existing front end in .Net

  3. #3
    Zac
    Zac is offline
    Constant Bitrate
    Join Date
    Feb 2004
    Location
    VA
    Posts
    192
    Here's the parts for the most part. I took a button example from CodeGuru and removed the shaped window part. Basically I need RelayOn called when first clicked and as soon as the mouse is released (the problem) or when the mouse moves outside the border (works fine) RelayOff gets called.

    And yes - I know the code is a mess...I'm just throwing sample code availble until I could get the basic result I want for testing.

    (also threw the listbox from the sample code back in there as it was the easiest way for a noob like me to see when it's actually getting called.)
    Attached Files Attached Files

  4. #4
    Raw Wave god_of_cpu's Avatar
    Join Date
    Jan 2004
    Location
    SilverSpring Maryland
    Posts
    2,960
    I stopped believing in rar in the 90s so I can't look at your code.

    But the WM_LBUTTONDOWN is only sent to the client area of the window the cursor is in. You can change this behavior by using the SetCapture function, but it will still only go to the one window you set the capture to.

    There are a number of ways to do what you want to do though. The ones I can think of off the top of my head are you can either pass a pointer to your dialog to your static class and call a member function off of it when you recieve the lbuttonup message or you can generate your own WM_COMMAND or WM_APP message, send it to the dialog window and process it there.
    StreetDeck.com Developer (I am Chuck)
    Get StreetDeck at http://www.streetdeck.com
    The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

  5. #5
    What can I say? I like serial. Curiosity's Avatar
    Join Date
    Mar 2004
    Location
    Florence Yall, BFKY
    Posts
    2,684
    Try OnNotify() or OnChildNotify() depending on if you put it in the window or button class. Also, the resources are missing in the rar.

  6. #6
    Zac
    Zac is offline
    Constant Bitrate
    Join Date
    Feb 2004
    Location
    VA
    Posts
    192
    Sorry couldn't post the resources because I'm using t-mo for net access and they block larger transfers.

  7. #7
    What can I say? I like serial. Curiosity's Avatar
    Join Date
    Mar 2004
    Location
    Florence Yall, BFKY
    Posts
    2,684
    No problem. I just finally remembered the important part. Use owner draw buttons. You'll get calls to CButtonrawItem(LPDRAWITEMSTRUCT) for down, up, etc. which will make it all easier.

Bookmarks

Posting Permissions

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