Click here to Skip to main content
15,884,822 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff11-Oct-12 10:20
Jumpin' 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
Jumpin' Jeff2-Nov-12 12:23 
GeneralRe: C# MIDI controller interface. Pin
Jumpin' Jeff16-Nov-12 5:36
Jumpin' 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
Jumpin' 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
dcof5-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
Member 81371055-Sep-12 10:21 
AnswerRe: Loosley Coupled Events Pin
Pete O'Hanlon5-Sep-12 10:27
mvePete O'Hanlon5-Sep-12 10:27 
GeneralRe: Loosley Coupled Events Pin
Member 81371055-Sep-12 10:30
Member 81371055-Sep-12 10:30 
GeneralRe: Loosley Coupled Events Pin
Pete O'Hanlon5-Sep-12 10:33
mvePete O'Hanlon5-Sep-12 10:33 
GeneralRe: Loosley Coupled Events Pin
Member 81371055-Sep-12 10:35
Member 81371055-Sep-12 10:35 
GeneralRe: Loosley Coupled Events Pin
Pete O'Hanlon5-Sep-12 10:44
mvePete O'Hanlon5-Sep-12 10:44 
GeneralRe: Loosley Coupled Events Pin
Member 81371055-Sep-12 10:46
Member 81371055-Sep-12 10:46 
GeneralRe: Loosley Coupled Events Pin
SledgeHammer015-Sep-12 11:53
SledgeHammer015-Sep-12 11:53 
GeneralRe: Loosley Coupled Events Pin
Member 81371055-Sep-12 11:56
Member 81371055-Sep-12 11:56 
GeneralRe: Loosley Coupled Events Pin
SledgeHammer015-Sep-12 12:05
SledgeHammer015-Sep-12 12:05 
GeneralRe: Loosley Coupled Events Pin
Member 81371055-Sep-12 12:18
Member 81371055-Sep-12 12:18 
GeneralRe: Loosley Coupled Events Pin
SledgeHammer015-Sep-12 12:23
SledgeHammer015-Sep-12 12:23 
GeneralRe: Loosley Coupled Events Pin
Member 81371055-Sep-12 12:51
Member 81371055-Sep-12 12:51 
GeneralRe: Loosley Coupled Events Pin
Member 81371056-Sep-12 6:50
Member 81371056-Sep-12 6:50 
Questionproblem executing console application Pin
dcof5-Sep-12 9:21
dcof5-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.