Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
QuestionUnmanaged callback, Dispose issue Pin
DaveyM6912-Aug-10 23:04
professionalDaveyM6912-Aug-10 23:04 
AnswerRe: Unmanaged callback, Dispose issue Pin
Luc Pattyn13-Aug-10 1:51
sitebuilderLuc Pattyn13-Aug-10 1:51 
GeneralRe: Unmanaged callback, Dispose issue Pin
DaveyM6913-Aug-10 2:17
professionalDaveyM6913-Aug-10 2:17 
AnswerRe: Unmanaged callback, Dispose issue Pin
Luc Pattyn13-Aug-10 2:46
sitebuilderLuc Pattyn13-Aug-10 2:46 
GeneralRe: Unmanaged callback, Dispose issue Pin
DaveyM6913-Aug-10 4:35
professionalDaveyM6913-Aug-10 4:35 
GeneralRe: Unmanaged callback, Dispose issue Pin
DaveyM6914-Aug-10 8:30
professionalDaveyM6914-Aug-10 8:30 
GeneralRe: Unmanaged callback, Dispose issue Pin
Luc Pattyn14-Aug-10 8:43
sitebuilderLuc Pattyn14-Aug-10 8:43 
GeneralRe: Unmanaged callback, Dispose issue Pin
DaveyM6914-Aug-10 9:07
professionalDaveyM6914-Aug-10 9:07 
Luc Pattyn wrote:
no need to test inputCount, outputCount


Redundant code from previous tests - oops!

Luc Pattyn wrote:
don't like the method name midiInGetNumDevs


That's an API function that I'm P/Invoking. It's not exposed externally in it's full ugliness.

Luc Pattyn wrote:
you'd better use int everywhere, there's too many casts right now


The API uses UINT for all these values so I'm using the same. The casts are for list creation as they require ints. I have thought about creating a genericlist that can hold UInt32.MaxValue elements to make sure there is no problem even with a rediculous number of devices available.

Luc Pattyn wrote:
what is "this"? isn't everything static there?


The finalizer runs on each MidiDevice instance. Only the lists in that class are static.

Luc Pattyn wrote:
I would never expect "this" in KeepAlive, as it is "this" that is running the code anyhow.


I did some reading up on the finalizer and that is not necessarily the case. Any objects the instance would normally hold could have already been finalized or in a race condition with this finalizer. Using this prevents this. This is what I've gathered from the brief reading I've done and should not be interpreted as fact!

Luc Pattyn wrote:
and do you really need it?


I don't think so as the static list is keeping it alive anyway AFIK.
Dave

If this helped, please vote & accept answer!


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

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

GeneralRe: Unmanaged callback, Dispose issue Pin
Luc Pattyn14-Aug-10 9:19
sitebuilderLuc Pattyn14-Aug-10 9:19 
GeneralRe: Unmanaged callback, Dispose issue Pin
DaveyM6914-Aug-10 9:31
professionalDaveyM6914-Aug-10 9:31 
Questionhow to session value in a page. Pin
Mubeen.asim12-Aug-10 21:38
Mubeen.asim12-Aug-10 21:38 
AnswerRe: how to session value in a page. Pin
Jens Meyer12-Aug-10 22:10
Jens Meyer12-Aug-10 22:10 
GeneralRe: how to session value in a page. Pin
Mubeen.asim12-Aug-10 23:17
Mubeen.asim12-Aug-10 23:17 
QuestionResize problem for drawn rectangle on the picture box? Pin
Nivas8212-Aug-10 20:27
Nivas8212-Aug-10 20:27 
AnswerRe: Resize problem for drawn rectangle on the picture box? Pin
Luc Pattyn13-Aug-10 2:05
sitebuilderLuc Pattyn13-Aug-10 2:05 
GeneralRe: Resize problem for drawn rectangle on the picture box? Pin
Nivas8217-Aug-10 20:30
Nivas8217-Aug-10 20:30 
GeneralRe: Resize problem for drawn rectangle on the picture box? Pin
Luc Pattyn18-Aug-10 1:41
sitebuilderLuc Pattyn18-Aug-10 1:41 
GeneralRe: Resize problem for drawn rectangle on the picture box? Pin
Nivas8223-Aug-10 2:12
Nivas8223-Aug-10 2:12 
AnswerRe: Resize problem for drawn rectangle on the picture box? Pin
Luc Pattyn23-Aug-10 2:16
sitebuilderLuc Pattyn23-Aug-10 2:16 
GeneralRe: Resize problem for drawn rectangle on the picture box? Pin
Nivas8223-Aug-10 23:09
Nivas8223-Aug-10 23:09 
GeneralRe: Resize problem for drawn rectangle on the picture box? Pin
Nivas8220-Oct-10 21:30
Nivas8220-Oct-10 21:30 
QuestionHow to load a referenced dll from specified location not GAC? Pin
Jack2009512-Aug-10 16:57
Jack2009512-Aug-10 16:57 
AnswerRe: How to load a referenced dll from specified location not GAC? Pin
PIEBALDconsult12-Aug-10 17:46
mvePIEBALDconsult12-Aug-10 17:46 
GeneralRe: How to load a referenced dll from specified location not GAC? Pin
Luc Pattyn12-Aug-10 18:07
sitebuilderLuc Pattyn12-Aug-10 18:07 
GeneralRe: How to load a referenced dll from specified location not GAC? Pin
PIEBALDconsult12-Aug-10 18:14
mvePIEBALDconsult12-Aug-10 18:14 

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.