Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check it broadband is working
Message
From
16/04/2008 06:17:35
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01311018
Message ID:
01311021
Views:
15
Hi Robin,

try this. Its an extract from a toolclass of mine. So usually its a object method fired with two parameters.
LPARAMETERS vDestIp as String, vSilent as Boolean
LOCAL lnDst as Integer, lnHop as Integer, lnRTT as Integer, llReturn as Boolean

DECLARE INTEGER GetRTTAndHopCount IN Iphlpapi;
   INTEGER DestIpAddress, LONG @HopCount,;
   INTEGER MaxHops, LONG @RTT
DECLARE INTEGER inet_addr IN ws2_32 STRING cp

WITH This

	._errorcode		= []
	._destinationip	= m.vDestIp
	lnDst			= inet_addr(._destinationip)
	lnHop			= 0
	lnRTT			= 0
	llReturn		= .F.

	IF GetRTTAndHopCount(lnDst, @lnHop, 5, @lnRTT) = 0

		TEXT TO lcMsg TEXTMERGE NOSHOW PRETEXT 3
			IP-Adress <<._destinationip>> doesn't respond
		ENDTEXT
	   
	ELSE

		TEXT TO lcMsg TEXTMERGE NOSHOW PRETEXT 3
			IP-Adresse <<._destinationip>> responded.
			(<<m.lnRTT>> MSek / <<m.lnHop>> Hops)
		ENDTEXT
		llReturn = .T.
		
	ENDIF

	IF !vSilent
		MESSAGEBOX(lcMsg,0+64+0,[Programminformation])
	ENDIF 

	._errorcode = lcMsg

ENDWITH 

* Returnvalue is .T. if Ping was successful
RETURN llReturn
Best Regards
-Tom

Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.

Oh, and BTW: 010101100100011001010000011110000101001001101111011000110110101101110011
Previous
Reply
Map
View

Click here to load this message in the networking platform