Thread: dialog size

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    205

    dialog size

    Hi,
    I have been trying to get the size of a dialog I created in the resource editor. I tried using GetClientRect() but it seems I can only use the one where only 1 parameter, the pointer to the RECT structure, can be passed to it.
    What I want to use is one where you can pass two parameters, the id of the dialog box and the pointer to the RECT structure. Anybody knows how to force Visual studio to give me that option. I am using this in a ChildFrame of an MDI application. Thanks
    Amish

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Use the scope resolution operator ( :: ) to explicitly use global namespace winapi functions, eg:
    Code:
    RECT rc;
    ::GetClientRect(hwnd,&rc);
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    The Win32 API function GetClientRect() takes an HWND, not an id.
    There are no MFC API's called GetClientRect() with two parameters, so you can simply call it. If MFC did have a version with two parameters then you can distinguish which one you want to call by using the scope resolution operator "::" like so:
    Code:
       ::GetClientRect(hwnd, pRect);
    gg

    [edit]linking to MSDN -> beaten by ken[/edit]

  4. #4
    Registered User
    Join Date
    Dec 2004
    Posts
    205
    Great using :: works but I hit another problem.
    Anybody would know how to pass messages from a view object to it's frame object in an MDI application. Thanks
    Amish

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. char Handling, probably typical newbie stuff
    By Neolyth in forum C Programming
    Replies: 16
    Last Post: 06-21-2009, 04:05 AM
  2. Fixing my program
    By Mcwaffle in forum C Programming
    Replies: 5
    Last Post: 11-05-2008, 03:55 AM
  3. Adventures in labyrinth generation.
    By guesst in forum Game Programming
    Replies: 8
    Last Post: 10-12-2008, 01:30 PM
  4. Splitting a dialog up into multiple classes
    By Just in forum Windows Programming
    Replies: 1
    Last Post: 05-29-2005, 11:11 PM
  5. char problem
    By eXistenZ in forum Windows Programming
    Replies: 36
    Last Post: 02-21-2005, 06:32 AM