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

Dialog doesn't show on other Computer

pgruhn
Beginner
517 Views

I have a little problem concerning a modeless dialogthat I use to host some controls.

The dialog is created via CreateDialogParam in the WM_CREATE part of my main window and is shown permanently. Everything works fine on the computer I write the application on, but when I start the executable on another machine, the dialog does not show. My log file shows me that no handle is returned from the CreateDialogParam routine (handle=0), but the LastError functions returns zero as well.

I tried this on two different machines (one WinXP pro, one Win XP). I also compiled the whole project one the laptop of someone elsewith the same versionof compiler(9.0.2713) VS.net (2003), and again the dialog doesn't show there.Still, everything is fine on my machine. Has anybody an idea what might be wrong here? Below you find the WM_CREATE part of my main window.

CASE (WM_CREATE)

OPEN(9,FILE='logfile.log',TYPE='REPLACE')

WRITE (9,'(A)') '(WM_CREATE) Create main window'

CALL InitOGlVars

! Show control dialog

ghDlgCtrl = CreateDialogParam(ghInstance,IDD_DLG_CTRL,hWnd,

LOC(CtrlDlgProc),0)

ret=GetLastError()

WRITE (9,*) ' CreateDialog (Handle,Err): ',ghDlgCtrl,ret

ret=ShowWindow(ghDlgCtrl, SW_SHOW)

WRITE (9,*) ' ShowDialog (ret): ',ret

ret=GetLastError()

WRITE (9,*) ' ShowDialog (Err): ',ret

! Show OGl (child) window

ret=GetClientRect(ghWndMain,rect)

ghwndChild = CreateWindowEx( 0,lpszCClassName, &

lpszCAppName, &

INT( WS_CHILD+WS_DLGFRAME+ &

WS_CLIPCHILDREN), &

widthDlgCtrl, &

0, &

widthOGl, &

heightOGl, &

hWnd, &

chWndID, &

ghInstance, &

NULL )

ret=ShowWindow(ghWndChild, SW_SHOW)

ret=GetDesktopWindow()

CALL CenterWindow (hwnd, ret)

MainWndProc = 0

RETURN

0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
517 Views
My first guess is that your dialog contains some common controls, but you didn't call InitCommonControls() API in the start. Depending on the environment, some loaded dlls may call InitCommonControls first, and there you don't have a problem; otherwise, the dialog will fail to load.
0 Kudos
pgruhn
Beginner
517 Views

Damn, you're good. I have an updown control, and didn't realize that it had to be registered first. Everything works fine now, thanks a lot.

0 Kudos
Reply