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

Problem with DlgInit when adding dialog to console application

grtoro
Beginner
466 Views
I am trying to add a dialog to a console application, but I am getting an error when calling dlginit. I was able to trace the error to a call to DlgGetRes. I am trying to follow the "CELSICON" sample.
Belowis a simple program I that am using to reproduce the problem.
What am I doing wrong? Any suggestions?
Thanks,
Gabriel
PS: I figured out how tobuild a working version of this toyprogram using the command line.Now, I want to do itwithin developer studio (the real program is very large and I would like to build it within Developer Studio. In essence, I need the developer studio to call rc so as to build the .res file and then make sure that the linker uses this .res file. I looked at the Project|Settings of CELSICON, made some changes in the "Resources" tab of my program, but it still does not work.
Help!!!!
! test_dialogs.f90
!
! FUNCTIONS:
!test_dialogs
!
!****************************************************************************
!
! PROGRAM: test_dialogs
!
! PURPOSE: Try using dialog in console application
!
!****************************************************************************
program test_dialogs
USE DFWIN
USE DFLOGM
INCLUDE 'RESOURCE.FD'
type(dialog) dlg
external DummyDialogCallback
logical lstat
!--------------------------------------------------------------------
lstat=DLGINITwithresourcehandle(MY_DIALOG,3,dlg)
istat=DLGSET(dlg,EDIT_1, 13)
istat=DlgSetSub( dlg, EDIT_1,DummyDialogCallback )
istat=dlgmodal(dlg)
write(*,*) 'return code from dlgmodal',istat
call dlguninit(dlg)
WRITE(*,*) 'BYE'
stop
end program test_dialogs
!****************************************************************************
!
! SUBROUTINE: DummyDialogCallback
!
! PURPOSE: not much
!
!****************************************************************************
SUBROUTINE DummyDialogCallback( dlg, control_name, callbacktype )
USE DFLOGM
IMPLICIT NONE
TYPE (dialog) dlg
INTEGER control_name
INTEGER callbacktype
INCLUDE 'RESOURCE.FD'
CHARACTER(256) text
INTEGER cel, far, retint
LOGICAL retlog
! Suppress compiler warnings for unreferenced arguments.
INTEGER local_callbacktype
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
local_callbacktype = callbacktype
RETURN
END SUBROUTINE DummyDialogCallback
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Message Edited by grtoro on 10-09-2005 06:25 PM

0 Kudos
0 Replies
Reply