Prev: arrangement of include files
Next: "Lock" splitter bar
From: Tom Serface on 6 Oct 2009 12:19 You could save yourself a lot of trouble (and probaby code) by just using an MDI or SDI application with a CFormView window. You'd get all of this functionality and more with a very small code footprint. You can easily swap views or even use a splitter window to display them both at once. You should try creating a sample small project and give it a look. I think it will make your task easier. Tom "hadi kazemi" <hadikazemi(a)discussions.microsoft.com> wrote in message news:ECCD32D2-0271-49FC-9037-10CEB75D0DC7(a)microsoft.com... > hi > i use window in my program user interface like this: > > [code] > > ... > ShowWindow( g_hWnd, nCmdShow ); > > UpdateWindow (g_hWnd) ; > > if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) > return 0; > > hInst = hInstance; > > // Main message loop > MSG msg = {0}; > > > while (!Done) > { > > ... > > [/code] > > now i want to use dialog instead window and then use : > > [code] > ... > > // ShowWindow( g_hWnd, nCmdShow ); > > if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) > returhn 0; > > hInst = hInstance; > > // Main message loop > MSG msg = {0}; > > BOOL Done = FALSE; > > DialogBox(g_hInst, MAKEINTRESOURCE(IDD_DIALOG2), g_hWnd, AboutDlgProc); > > while (!Done) > { > > ... > [/code] > > but my program dont run code after DialogBox ! now what i do ?
From: Joseph M. Newcomer on 10 Oct 2009 19:15
The code shown makes no sense. Why are you writing a message loop of your own? That's what MFC is for. joe On Mon, 5 Oct 2009 22:34:01 -0700, hadi kazemi <hadikazemi(a)discussions.microsoft.com> wrote: >hi >i use window in my program user interface like this: > >[code] > >... > ShowWindow( g_hWnd, nCmdShow ); > > UpdateWindow (g_hWnd) ; > > if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) > return 0; > > hInst = hInstance; > > // Main message loop > MSG msg = {0}; > > > while (!Done) > { > >... > >[/code] > >now i want to use dialog instead window and then use : > >[code] >... > >// ShowWindow( g_hWnd, nCmdShow ); > > if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) > returhn 0; > > hInst = hInstance; > > // Main message loop > MSG msg = {0}; > > BOOL Done = FALSE; > > DialogBox(g_hInst, MAKEINTRESOURCE(IDD_DIALOG2), g_hWnd, AboutDlgProc); > > while (!Done) > { > >... >[/code] > >but my program dont run code after DialogBox ! now what i do ? Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm |