Pb With API and GetComputerName

BlitzMax Forums/BlitzMax Programming/Pb With API and GetComputerName

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.

Hello :)

I'm trying to use the API Windows Commands, but it works an half lol

I would like to test GetComputerName (kernel32.dll).

I wrote some code but I have only the 4 first letters of my computer name :( but I can't have the computer name complete.

Here's the code I've written :

'Code Test

Global GetComputerName(lpbuffer:Byte Ptr,nSize:Long Ptr)

Local taille:Long 
Local name:Byte

kernel32 = LoadLibraryA("kernel32.dll")

If kernel32
	GetComputerName = GetProcAddress(kernel32,"GetComputerNameA")
Else
	Notify("Failed")
EndIf

taille = 100


GetComputerName(Varptr name,Varptr taille)

Print String.FromCString(Varptr name)


Any idea ?

Thx in advance