Results 1 to 5 of 5

Thread: A few questions on MFC...

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    When I use the following code to display a messagebox with an information icon, I get OK & Cancel:

    Code:
    	MessageBox("Now opening CyberCarsten's Website", "CyberCarsten's Website", MB_OK || MB_ICONINFORMATION);
    Also how can I have a messagebox pop up with the path to the windows directory using GetWindowsDirectory ???
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  2. #2
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772
    Not sure, but I think there is supposed to be only one | in the message box type.
    Last edited by Wynd; Mar 31st, 2001 at 02:28 PM.
    Alcohol & calculus don't mix.
    Never drink & derive.

  3. #3
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    || is logical OR, | is bitwise OR. The constants you are using to define different attributes of the messagebox are bit flags which you need to bitwise OR together to get all the flags in one variable. So use just one pipe character ( | )
    Harry.

    "From one thing, know ten thousand things."

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Code:
    TCHAR pcBuf[MAX_PATH];
    
    GetWindowsDirectory(pcBuf, MAX_PATH);
    MessageBox(NULL, pcBuf, "Windows folder!", MB_OK);
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    Thanks guys! That worked out perfectly!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

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