CallDLL ws2_32.dll - help needed

Blitz3D Forums/Blitz3D Beginners Area/CallDLL ws2_32.dll - help needed

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

1. How would I write a decls for the gethostname function?
2. Failing #1...I wish to make Blitz functions for all functions within "ws2_32.dll"

hostname$ = GetHostName()
Print hostname$
WaitKey()
End


Function GetHostName$()
	tempbuffer$ = String$(" ", 63)
	tempbank = CreateBank(Len(tempbuffer$)+4)
	PokeByte tempbank,Len(tempbuffer$),4
	CallDLL ("ws2_32.dll", "gethostname", tempbank)
	For temp = 0 To Len(tempbuffer$)-1
		tempbyte = PeekByte (tempbank,temp)
		If tempbyte <> 0 Then tempname$ = tempname$ + Chr$(PeekByte (tempbank,temp))
	Next
	FreeBank tempbank
	Return tempname$
End Function