In compiling my program I get a bunch of warnings having to do with creating and opening dialogs and windows. The code compiles and runs fine though.
Begin pasted compiler warnings:
File: E:\Check-In Package iwb\Check-In Package Program.iwb (1678) Warning: Argument 9 (dAbout_handler) does not match the declaration of IWBDLGPROC
Different return type: none, should be int
File: C:\Program Files (x86)\iwbdev\bin\iwbstd.incc (9) Warning: See previous declaration of IWBDLGPROC
End pasted compiler warnings:
Line 1678 is the following;
CREATEDIALOG dAbout,0,0,wDialog,hDialog,Options,win,"About Jim's Check-In Package Program",&dAbout_handler
The compiler is saying &dAbout_handler should be type Integer. Isn't it an address created at run time? Do I just ignore these messages?
&dAbout_handler should be a subroutine that is used to handle the messages from the Dialog.
Sub dAbout_handler(),int
SELECT @MESSAGE
CASE @IDCHAR
MESSAGEBOX d1,CHR$(@CODE) + " Key Pressed","Info"
CASE @IDINITDIALOG
CENTERWINDOW d1
CASE @IDCLOSEWINDOW
CASE& @IDDESTROY
SetWindowLongA(hLV,GWL_WNDPROC,origfp)
CLOSEDIALOG d1,@IDOK
run1 = 0
ENDSELECT
RETURN 0
ENDSUB
Bill is correct
prior to ver 2.0 of IWbasic you could write a message handler like this
Sub dAbout_handler()
message handlers were treated as a special case in the compiler and the missing ",INT" was handled internally by the compiler.
When the compiler code was optimized in version 2.0 the compiler treats message handlers like any other subroutine.
So the proper way to to define the handler is
Sub dAbout_handler(),intbut to keep from totally breaking all old code it generates a warning instead of an error.
The compiler is still adding the ",int" internally but it is letting you know the code isn't optimized with the warning.
Went through and changed all to include both the (), Int and the Return 0 to all handler subroutines and the warnings went away.
Thanks
PS: Reminds me of the procedure vs. function arguments of days gone by... Donde esta mi amigo Pascal?