Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Modeless Dialog Create Fails

Brooks_Van_Horn
New Contributor I
2,237 Views

I constructed my RC file in Visual Studio 2013, but I developed my .f90 files outside of VS once they were created in VS as a fram for an SDI file. I am trying to create something like the Angle project with a dialog as the main window and perform graphics in the SDI framework. My dialog styles are exactly as the main dialog in Angle. The RC compiles my rc-file with no warnings or errors. I'm using:

Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.0.110 Build 20150815
My build gives no warnings nor errors as:

g:\Desktop\Pearson>rc Pearson.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.3.9600.17298
Copyright (C) Microsoft Corporation.  All rights reserved.
g:\Desktop\Pearson>rem ifort /nologo /c PearsonGlobals.f90
g:\Desktop\Pearson>ifort /nologo /WinApp Pearson.f90 MyLib.Lib Pearson.res

My code to startup the dialog looks like:

     bret = DlgInit( IDD_PMAIN, gDlg)
     If (bret == FALSE) Then
        ret = MessageBox(0, "DlgInit failed to launch IDD_PMAIN"C, "SetUpMyDlg"C, MB_OK)
        Call PostQuitMessage(999)
        return
     End If
     hDlg = gDlg%HWND
     hWndDlg = hDlg
     bret = DlgSetSub(gdlg, IDD_PMAIN, WinDlgSub)
     type *, 'SetUpMyDlg:: DlgSetSub(IDD_PMAIN) RC = ', bret
     bret = DlgSetSub(gDlg, IDC_FIT, DlgChanged)
     type *, 'SetUpMyDlg:: DlgSetSub(IDC_FIT) RC = ', bret
     bret = DlgSetSub(gDlg, IDC_SAMP, DlgChanged)
     type *, 'SetUpMyDlg:: DlgSetSub(IDC_SAMP) RC = ', bret
     bret = DlgSetSub (gDlg, IDC_PCTYPE, OnSpinEdit, DLG_LOSEFOCUS)
     type *, 'SetUpMyDlg:: DlgSetSub(IDC_IDC_PCTYPE) RC = ', bret
     bret = DlgModeless(gDlg, nCmdShow)
     type *, 'SetUpMyDlg:: DlgModeless RC = ', bret
     If (bret == FALSE) Then
        ret = MessageBox(0, "DlgModeless failed for IDD_PMAIN"C, "SetUpMyDlg"C, MB_OK)
        Call PostQuitMessage(998)
        return
     End If

My debug produces:

 SetUpMyDlg:: DlgSetSub(IDD_PMAIN) RC =  T
 SetUpMyDlg:: DlgSetSub(IDC_FIT) RC =  T
 SetUpMyDlg:: DlgSetSub(IDC_SAMP) RC =  T
 SetUpMyDlg:: DlgSetSub(IDM_EXIT) RC =  F
 SetUpMyDlg:: DlgSetSub(IDC_IDC_PCTYPE) RC =  T
 SetUpMyDlg:: DlgModeless RC =  F


And then I get the MessageBox notice. Can anyone help me?

Thanks, Brooks

0 Kudos
6 Replies
mecej4
Honored Contributor III
2,237 Views

The debug output that you showed is not matched to the code that you showed. Specifically, there is no line of code among those shown that could have produced the output "SetUpMyDlg:: DlgSetSub(IDM_EXIT) RC =  F".

0 Kudos
Brooks_Van_Horn
New Contributor I
2,237 Views

Yes, I had deleted that after I captured my debug output.

Sorry about that.

 

Brooks

0 Kudos
andrew_4619
Honored Contributor III
2,237 Views

So after the dlg modeless call do you enter "WinDlgSub" with callbacktype =  DLG_INIT status?

 

 

 

0 Kudos
Brooks_Van_Horn
New Contributor I
2,237 Views

don't know. No debug there.

However...Don't know what I did but it's working now. Thanks much for talking.

 

Brooks

0 Kudos
dboggs
New Contributor I
2,237 Views

When you say "perform graphics in the SDI framework" what does that mean? Are you planning on coding your own graphics using primitive graphic functions, in IVF? If so that requires a "Quickwin" project type, and that would in turn imply an MDI framework, not SDI. But I know nothing about "the Angle project" so I may be completely off base here.

0 Kudos
Steven_L_Intel1
Employee
2,237 Views

Angle is one of the Win32 samples. It doesn't use QuickWin.

0 Kudos
Reply