| | |
(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; Nov 5th, 2009 at 11:21 am.
•
•
Join Date: Mar 2008
Posts: 1,482
Reputation:
Solved Threads: 122
0
#2 Nov 5th, 2009
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; Nov 5th, 2009 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 |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamic dynamiccharacterarray email encryption error file format forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib library linker list loop looping loops map math matrix memory microsoft newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings temperature template templates test text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






