| | |
(IDE) [VC++ 6.0] Dialog Control [Not MFC]
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2009
Posts: 11
Reputation:
Solved Threads: 0
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
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.
•
•
Join Date: Mar 2008
Posts: 1,411
Reputation:
Solved Threads: 114
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:
And, if all else fails, you can do it programically: Hope this helps.
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
ENDAnd, 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;
} Last edited by William Hemsworth; 23 Days Ago at 7:40 pm.
I need pageviews! most fun profile ever :)
![]() |
Similar Threads
- Common Dialog Control (Visual Basic 4 / 5 / 6)
- Run external EXE from within an MFC dialog control (C++)
- Problem using Common Dialog control (Visual Basic 4 / 5 / 6)
- Please help me open a html document in a rich text box via the common dialog control (Visual Basic 4 / 5 / 6)
- FileOpen Dialog without using Common Dialog Control (Visual Basic 4 / 5 / 6)
Other Threads in the C++ Forum
- Previous Thread: coding help, reverse array, check for palindrome
- Next Thread: Host intrusion detection system- help required
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count data database delete deploy developer dll download dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings struct temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






