Passing a type to a DLL API

BlitzMax Forums/BlitzMax Programming/Passing a type to a DLL API

another way without the .c but still using banks. other than having to count your bytes, banks are fantastic for this stuff.

Extern "Os"
Function midiOutGetDevCapsA( uDeviceID:Int, lpCaps:Byte Ptr, uSize:Int)
End Extern

Local tb:TBank=CreateBank(52)

DebugLog(midiOutGetDevCapsA(0, BankBuf(tb), 52))

DebugLog("wMid: "+PeekShort(tb,0))
DebugLog("wPid: "+PeekShort(tb,2))
DebugLog("vDriverVersion: "+PeekInt(tb,4))

Local name:String
For i=0 To 31
	name:+Chr(PeekByte(tb,8+i))
Next
DebugLog("szPname: "+name)
DebugLog("wTechnology: "+PeekShort(tb,40))
DebugLog("wVoices: "+PeekShort(tb,42))
DebugLog("wNotes: "+PeekShort(tb,44))
DebugLog("wChannelMask: "+PeekShort(tb,46))
DebugLog("dwSupport: "+PeekInt(tb,48))