Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. long!=long? //RECT problem

long!=long? //RECT problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IndrekSnt
    wrote on last edited by
    #1

    RECT rect; LPCRECT rect2; AfxGetApp()->GetMainWnd()->GetClientRect(&rect); rect2->left=rect.left; rect2->right=rect.right; rect2->top=rect.top; rect2->bottom=rect.bottom/6; cdc->FillRect(rect2,cb); :wtf::confused: Why isn't this thing working? I know no other way of copying rects. Any suggestions are welcome. --- Blääh

    D J W 3 Replies Last reply
    0
    • I IndrekSnt

      RECT rect; LPCRECT rect2; AfxGetApp()->GetMainWnd()->GetClientRect(&rect); rect2->left=rect.left; rect2->right=rect.right; rect2->top=rect.top; rect2->bottom=rect.bottom/6; cdc->FillRect(rect2,cb); :wtf::confused: Why isn't this thing working? I know no other way of copying rects. Any suggestions are welcome. --- Blääh

      D Offline
      D Offline
      Dominik Reichl
      wrote on last edited by
      #2

      LPCRECT is a pointer, so do this:

      RECT rect;
      RECT rect2templ;
      LPCRECT rect2 = &rect2templ;

      AfxGetApp()->GetMainWnd()->GetClientRect(&rect);
      rect2->left=rect.left; rect2->right=rect.right;
      rect2->top=rect.top; rect2->bottom=rect.bottom/6;
      cdc->FillRect(rect2,cb);

      :-D Dominik


      _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;) (doesn't work on NT)

      I 1 Reply Last reply
      0
      • D Dominik Reichl

        LPCRECT is a pointer, so do this:

        RECT rect;
        RECT rect2templ;
        LPCRECT rect2 = &rect2templ;

        AfxGetApp()->GetMainWnd()->GetClientRect(&rect);
        rect2->left=rect.left; rect2->right=rect.right;
        rect2->top=rect.top; rect2->bottom=rect.bottom/6;
        cdc->FillRect(rect2,cb);

        :-D Dominik


        _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;) (doesn't work on NT)

        I Offline
        I Offline
        IndrekSnt
        wrote on last edited by
        #3

        Hmm, thanks, it helped me out... :) --- Blääh

        1 Reply Last reply
        0
        • I IndrekSnt

          RECT rect; LPCRECT rect2; AfxGetApp()->GetMainWnd()->GetClientRect(&rect); rect2->left=rect.left; rect2->right=rect.right; rect2->top=rect.top; rect2->bottom=rect.bottom/6; cdc->FillRect(rect2,cb); :wtf::confused: Why isn't this thing working? I know no other way of copying rects. Any suggestions are welcome. --- Blääh

          J Offline
          J Offline
          Jorgen Sigvardsson
          wrote on last edited by
          #4

          Ask yourself the following question; Where does rect2 point? Also, since you're using MFC, why not use CRect? -- Sancte Míchael Archángele, defénde nos in proélio contra nequítiam et insídias diáboli esto præsídium. Imperet illi Deus, súpplices deprecámur: tuque, princeps milítiæ cæléstis, Sátanam aliósque spíritus malígnos, qui ad perditiónem animárum pervagántur in mundo, divína virtúte, In inférnum detrude. Amen.

          1 Reply Last reply
          0
          • I IndrekSnt

            RECT rect; LPCRECT rect2; AfxGetApp()->GetMainWnd()->GetClientRect(&rect); rect2->left=rect.left; rect2->right=rect.right; rect2->top=rect.top; rect2->bottom=rect.bottom/6; cdc->FillRect(rect2,cb); :wtf::confused: Why isn't this thing working? I know no other way of copying rects. Any suggestions are welcome. --- Blääh

            W Offline
            W Offline
            WoutL
            wrote on last edited by
            #5

            Why not try this: CRect rect, rect2; AfxGetApp()->GetMainWnd()GetClientRect(&rect); rect2 = rect; rect2.bottom /= 6; cdc->FillRect(rect2, cb); Or CRect rect; AfxGetApp()->GetMainWnd()GetClientRect(&rect); rect.bottom /= 6; cdc->FillRect(rect, cb); if you don't have to use rect anyfurther... Wout Louwers

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups