You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu) http://zijlema.basicguru.eu *** Opinions expressed here are not necessarily untrue ***
Sorry about that. I forgot PB9 lets you get away with not declaring a function, so I never caught that I missed one.
Code in source code forum has now been edited to include
Code:
DECLARE FUNCTION GetUdtDeviceEvent( _
DeviceBroadCastHeader AS DEV_BROADCAST_HDR, _
DeviceBroadCastOem AS DEV_BROADCAST_OEM, _
DeviceBroadCasteDevNode AS DEV_BROADCAST_DEVNODE, _
DeviceBroadCastVolume AS DEV_BROADCAST_VOLUME, _
DeviceBroadCastPort AS DEV_BROADCAST_PORT, _
DeviceBroadCastNet AS DEV_BROADCAST_NET, _
DeviceBroadCastDeviceInterface AS DEV_BROADCAST_DEVICEINTERFACE, _
DeviceBroadCastHandle AS DEV_BROADCAST_HANDLE, _
BYVAL lParam AS LONG _
)AS STRING
Hmmmm....makes me wonder if there is a compiler directive to still force me to declare all subs and functions, or if I am at the mercy of my own mind to double-triple check that I got them all???
Engineer's Motto: If it aint broke take it apart and fix it
"If at 1st you don't succeed... call it version 1.0"
"Half of Programming is coding"....."The other 90% is DEBUGGING"
"Document my code????" .... "WHYYY??? do you think they call it CODE? "
Didn't help very much. Apparently there's more that needs to be declared. Now I ran into an "undefined type" error for DEV_BROADCAST_HDR.
A further remark: declarations for functions inside an Include-file need to be done before the #INCLUDE metastatement, so this is the correct order:
Code:
#COMPILE EXE
#DIM ALL
GLOBAL hDlg AS DWORD
'------------------------------------------------------------------------------
' ** Constants **
'------------------------------------------------------------------------------
%IDD_DIALOG1 = 101
%TxtDeviceNotify = 102
'------------------------------------------------------------------------------
'------------------------------------------------------------------------------
' ** Declarations **
'------------------------------------------------------------------------------
DECLARE CALLBACK FUNCTION ShowDIALOG1Proc()
DECLARE FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
DECLARE FUNCTION GetUdtDeviceEvent( _
DeviceBroadCastHeader AS DEV_BROADCAST_HDR, _
DeviceBroadCastOem AS DEV_BROADCAST_OEM, _
DeviceBroadCasteDevNode AS DEV_BROADCAST_DEVNODE, _
DeviceBroadCastVolume AS DEV_BROADCAST_VOLUME, _
DeviceBroadCastPort AS DEV_BROADCAST_PORT, _
DeviceBroadCastNet AS DEV_BROADCAST_NET, _
DeviceBroadCastDeviceInterface AS DEV_BROADCAST_DEVICEINTERFACE, _
DeviceBroadCastHandle AS DEV_BROADCAST_HANDLE, _
BYVAL lParam AS LONG _
)AS STRING
'------------------------------------------------------------------------------
'------------------------------------------------------------------------------
' ** Includes **
'------------------------------------------------------------------------------
#IF NOT %DEF(%WINAPI)
#INCLUDE "WIN32API.INC"
#ENDIF
#IF NOT %DEF(%DEVICENOTIFY)
#INCLUDE "DeviceNotify.INC"
#ENDIF
'------------------------------------------------------------------------------
Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu) http://zijlema.basicguru.eu *** Opinions expressed here are not necessarily untrue ***
Now I ran into an "undefined type" error for DEV_BROADCAST_HDR.
??????
I went back and checked and re-checked, and no problem with 8.04 and up, and then I tried moving the declarations like you showed. and THAT is when the error occurs because Declaring Functions that use types before the type is defined will cause the error.
Which is why the Declares are Declared where they are.
Engineer's Motto: If it aint broke take it apart and fix it
"If at 1st you don't succeed... call it version 1.0"
"Half of Programming is coding"....."The other 90% is DEBUGGING"
"Document my code????" .... "WHYYY??? do you think they call it CODE? "
I get either the first mentioned error or the other one when changing "the order of appearance" in the demo-file. To be honest, I get the feeling that the code as posted is incomplete. Can you please post a zip attachment of the code that worked under PBWin 8.04?
Thanks,
Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu) http://zijlema.basicguru.eu *** Opinions expressed here are not necessarily untrue ***
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment