(IDE) [VC++ 6.0] Dialog Control [Not MFC]

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2009
Posts: 11
Reputation: scriptkiddy is an unknown quantity at this point 
Solved Threads: 0
scriptkiddy scriptkiddy is offline Offline
Newbie Poster

(IDE) [VC++ 6.0] Dialog Control [Not MFC]

 
1
  #1
23 Days Ago
Hi guys, I am just wondering how to implement a dialog I have made in Microsoft C++ 6.0

So I created a C++ project, then added a .rc script file. Then I added a new item to it (dialog control, called IDD_MENU) Now, I am wondering how would I use this menu inside my code? I have worked with WINAPI and spent hours coding GUIS. Just yesterday I downloaded C++ 6.0 (my new compiler, instead of Code::Blocks. Could save me hours of time!) and I am wondering how would I use the GUI I created? I have tried implementing it the same way I usually do for WINAPI, but this did not work. How do I do this? I have searched google for 1 day now, and I have not found anything. Hopefully somebody could help me out on this.

Thanks,
Chris
Last edited by scriptkiddy; 23 Days Ago at 11:21 am.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1,411
Reputation: William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of 
Solved Threads: 114
Sponsor
William Hemsworth William Hemsworth is offline Offline
Nearly a Posting Virtuoso
 
0
  #2
23 Days Ago
In version 8, you can just do it from the dialog interface, scroll down to the 'Menu' option, and select the name of the menu you created (view screenshot)

If you can't do that, you could edit the resource file directly, for example:
IDD_MAIN DIALOGEX 0, 0, 186, 94
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
MENU IDR_MENUNAME
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,129,24,50,14
END

And, if all else fails, you can do it programically:
int CALLBACK WndProc(
      HWND hwnd,
      UINT msg,
      WPARAM wParam,
      LPARAM lParam)
{
  switch ( msg ) {
    case WM_INITDIALOG:
      {
        HINSTANCE hInstance = GetModuleHandle( NULL );
        SetMenu( hwnd, LoadMenu(hInstance, MAKEINTRESOURCE(IDR_MENU1)) );
      }
      break;
    case WM_CLOSE:
      {
        EndDialog( hwnd, 0 );
      }
      break;
  }
  return 0;
}
Hope this helps.
Last edited by William Hemsworth; 23 Days Ago at 7:40 pm.
Attached Thumbnails
prev1.jpg  
I need pageviews! most fun profile ever :)
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC