jaberwacky Posted April 29, 2011 Share Posted April 29, 2011 (edited) I'm attempting to work with the stream functions found in Eynstyne's midi udf, but I've run into an obstacle that I cannot for the life of me overcome. MSDN says that midiStreamProperty needs a pointer to either a MIDIPROPTEMPO or a MIDIPROPTIMEDIV struct. The problem is that the struct has to be cast to an LPBYTE?MMRESULT midiStreamProperty( HMIDISTRM hm, LPBYTE lppropdata, <-- "Pointer to the property data." ??? DWORD dwProperty );Here is what I have so far:Func _midiStreamProperty_GetTimeDiv( Const $hmidiStream ) Local Const $midiprop_timediv = DllStructCreate( "dword;dword" ) DllStructSetData( $midiprop_timediv , 1 , DllStructGetSize( $midiprop_timediv ) ) Local Const $ret = DllCall( $winmm_dll , $MMRESULT , "midiStreamProperty" , _ "handle" , $hmidiStream , _ "ptr" , DllStructGetPtr( $midiprop_timediv ) , _ "dword" , BitOR( $MIDIPROP_GET , $MIDIPROP_TIMEDIV ) ) If Not @error Then Switch $ret[ 0 ] Case 1 To 20 SetError( 1 , $ret[ 0 ] ) Case 0 Return DllStructGetData( $midiprop_timediv , 2 ) EndSwitch Else SetError( 2 , @error ) EndIf EndFuncI've read that lpbyte is a long pointer to a byte. So, essentially a pointer to an array of bytes?One possibility I just found is to use the undocumented VarPtr. I have my doubts though.I've also come across _WinAPI_StringFromGUID() but that doesn't satisfy midiStreamProperty() either. Edited April 29, 2011 by LaCastiglione Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now