Win Functions without Referenced File?

BlitzMax Forums/BlitzMax Programming/Win Functions without Referenced File?

BLaBZ(Posted 2014) [#1]
I'm really confused by this code, how do these external functions know where to look? There's no referenced dll or external file?

Module toad.counter
Extern "Win32"

Function QueryPerformanceCounter(lpPerformanceCount:Long Var)
Function QueryPerformanceFrequency(lpFrequency:Long Var)

End Extern

Function GetTicks:Long()
	Local Ticks:Long
	
	If QueryPerformanceCounter(Ticks)
		Return Ticks
	Else
		Return 0
	End If
End Function

Function GetMillisecs:Double()
	Global Firstcall:Int = True
	Global Frequency:Long
	Local Ticks:Long
	
	If Firstcall
		QueryPerformanceFrequency(Frequency)
		Firstcall = False
	End If
	
	If QueryPerformanceCounter(Ticks)
		Return (Double(Ticks * 1000) / Frequency)
	Else
		Return 0
	End If
End Function



Brucey(Posted 2014) [#2]
Because they are part of Kernel32, which is linked to your application at compile time.