Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pointers in VFP?
Message
De
05/10/2006 06:07:57
 
 
À
04/10/2006 10:45:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01158687
Message ID:
01159601
Vues:
25
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform