
Announcement
Collapse
No announcement yet.
Cliff Nichols' USB and Network code
Collapse
X
-
Cliff,
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,
Leave a comment:
-
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.
Leave a comment:
-
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 '------------------------------------------------------------------------------
Leave a comment:
-
Code Edited
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
Leave a comment:
-
Cliff Nichols' USB and Network code
The USB and Network code, as posted by Cliff Nichols in the Source Code forum (http://www.powerbasic.com/support/pb...ad.php?t=39661) does not compile. The error is: Missing declaration for GetUdtDeviceEvent.
Version problem? I'm still using PBWin 8.4.Tags: None
Leave a comment: