Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pointers in VFP?
Message
From
05/10/2006 06:07:57
 
 
To
04/10/2006 10:45:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01158687
Message ID:
01159601
Views:
24
Hello Tracy,

see inline comments.
sizeof = REPLICATE(' ',2048)+CHR(0)
i = 1
nInfo = REPLICATE(' ',2048)+CHR(0)
PSP_DEVINFO_DATA = []

lnpointer = 0
DO WHILE .T.
	lnpointer =  SetupDiGetClassDevs(@cGuid,null,0,DIGCF_INTERFACEDEVICE)
	IF TYPE('lnpointer') = "N" .and. lnpointer > 0
		lldestroy = .t.
		? '        Handle to Device Set: '
		?? ALLTRIM(STR(lnpointer))
		DeviceInfoSet = lnpointer

		i = 0 && first interface is retrieved by passing 0
                LOCAL lcInterfaceData

                DO WHILE .T.
                    && setup a SP_DEVICE_INTERFACE_DATA structure,
                    && BINTOC sets dwSize member to 28, + SPACE(24) for the 
                    && rest of the structure
                    lcInterfaceData = BINTOC(28,'RS') + SPACE(24)

		IF !SetupDiEnumDeviceInterfaces(DeviceInfoSet, 
                        @nInfo , @cGuid, i, @lcInterfaceData)


             		IF GetLastError() = ERROR_NO_MORE_ITEMS
           	         	EXIT
                 	ELSE
	                	EXIT
                        ENDIF

                ELSE

                   &&& extract the interface data here ... (CTOBIN, SUBSTR)

                   && increment i for next interface
                   i = i + 1
	       ENDIF

               ENDDO

	ENDIF
ENDDO

....
....
the value returned from SetupDiGetClassDevs is a HANDLE, just like a HWND (window handle). It's not an array, its just a single 32bit value you pass on plain to other functions.

Regards
Christian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform