Click here to Skip to main content
15,310,056 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff11-Oct-12 10:20
MemberJumpin' Jeff11-Oct-12 10:20 
GeneralRe: C# MIDI controller interface. Pin
DaveyM6911-Oct-12 10:52
professionalDaveyM6911-Oct-12 10:52 
GeneralRe: C# MIDI controller interface. Pin
DaveyM692-Nov-12 8:54
professionalDaveyM692-Nov-12 8:54 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff2-Nov-12 12:23
MemberJumpin' Jeff2-Nov-12 12:23 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff16-Nov-12 5:36
MemberJumpin' Jeff16-Nov-12 5:36 
GeneralRe: C# MIDI controller interface. Pin
DaveyM6916-Nov-12 6:22
professionalDaveyM6916-Nov-12 6:22 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff16-Nov-12 13:17
MemberJumpin' Jeff16-Nov-12 13:17 
GeneralRe: C# MIDI controller interface. Pin
DaveyM6916-Nov-12 20:32
professionalDaveyM6916-Nov-12 20:32 
Correct, and no problem.

dwBufferLength needs to be set to the size (in bytes) of the buffer.
lpData needs to be a valid memory location that unmanaged code can write to. I use Marshal.AllocHGlobal using the same value as dwBufferLength. Make sure you free this once it's returned with Marshal.FreeHGlobal.

dwBytesRecorded will tell you how many bytes have been received.
If the buffer isn't big enough, or more SysEx is received it will use the next buffer so you need to ensure you have at least two available.

You only need to clear the flags if you are reusing the buffer once you are done with a used one. Reusing can give better performance as there is no need to be constantly allocating and freeing memory. I just add new new ones and discard the old personally.
Dave

Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.
Astonish us. Be exceptional. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)



QuestionC# 2008 with linq reference problem Pin
dcof5-Sep-12 12:17
Memberdcof5-Sep-12 12:17 
AnswerRe: C# 2008 with linq reference problem Pin
Shameel5-Sep-12 20:35
professionalShameel5-Sep-12 20:35 
QuestionLoosley Coupled Events Pin
Member 81371055-Sep-12 10:21
MemberMember 81371055-Sep-12 10:21 
AnswerRe: Loosley Coupled Events Pin
Pete O'Hanlon5-Sep-12 10:27
mvaPete O'Hanlon5-Sep-12 10:27 
GeneralRe: Loosley Coupled Events Pin
Member 81371055-Sep-12 10:30
MemberMember 81371055-Sep-12 10:30 
GeneralRe: Loosley Coupled Events Pin
Pete O'Hanlon5-Sep-12 10:33
mvaPete O'Hanlon5-Sep-12 10:33 
GeneralRe: Loosley Coupled Events Pin
Member 81371055-Sep-12 10:35
MemberMember 81371055-Sep-12 10:35 
GeneralRe: Loosley Coupled Events Pin
Pete O'Hanlon5-Sep-12 10:44
mvaPete O'Hanlon5-Sep-12 10:44 
GeneralRe: Loosley Coupled Events Pin
Member 81371055-Sep-12 10:46
MemberMember 81371055-Sep-12 10:46 
GeneralRe: Loosley Coupled Events Pin
SledgeHammer015-Sep-12 11:53
MemberSledgeHammer015-Sep-12 11:53 
GeneralRe: Loosley Coupled Events Pin
Member 81371055-Sep-12 11:56
MemberMember 81371055-Sep-12 11:56 
GeneralRe: Loosley Coupled Events Pin
SledgeHammer015-Sep-12 12:05
MemberSledgeHammer015-Sep-12 12:05 
GeneralRe: Loosley Coupled Events Pin
Member 81371055-Sep-12 12:18
MemberMember 81371055-Sep-12 12:18 
GeneralRe: Loosley Coupled Events Pin
SledgeHammer015-Sep-12 12:23
MemberSledgeHammer015-Sep-12 12:23 
GeneralRe: Loosley Coupled Events Pin
Member 81371055-Sep-12 12:51
MemberMember 81371055-Sep-12 12:51 
GeneralRe: Loosley Coupled Events Pin
Member 81371056-Sep-12 6:50
MemberMember 81371056-Sep-12 6:50 
Questionproblem executing console application Pin
dcof5-Sep-12 9:21
Memberdcof5-Sep-12 9:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.