Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
GeneralRe: Unmanaged function pointers / Marshal.GetFunctionPointerForDelegate Pin
DaveyM6916-Jun-09 13:25
professionalDaveyM6916-Jun-09 13:25 
GeneralRe: Unmanaged function pointers / Marshal.GetFunctionPointerForDelegate Pin
Luc Pattyn16-Jun-09 14:10
sitebuilderLuc Pattyn16-Jun-09 14:10 
Hi Dave,


DaveyM69 wrote:
To keep the instance alive, I have a private static list of open devices and ...


That should be fine, although I would probably prefer to have the delegate as an instance member of your device object, rather than in a static list. I probably would also have a static list of devices, either just for debugging or to make sure they remain alive if that's useful. Or I would try and create such device objects with a using construct provided that fits the overall software architecture.


DaveyM69 wrote:
I haven't managed to call the Close without runtime errors from a finalizer


That doesn't ring any bells (maybe the symptoms are too vague to ring anything). I trust you are aware all finalizers are ran from a single low-priority thread in the GC (not necessarily soon), and having a finalizer throwing uncatched exceptions is (or at least has been) a bad idea. That reminds me it has been a long time I researched finalizers...

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.

GeneralRe: Unmanaged function pointers / Marshal.GetFunctionPointerForDelegate Pin
DaveyM6917-Jun-09 0:46
professionalDaveyM6917-Jun-09 0:46 
GeneralRe: Unmanaged function pointers / Marshal.GetFunctionPointerForDelegate Pin
DaveyM6917-Jun-09 9:07
professionalDaveyM6917-Jun-09 9:07 
GeneralRe: Unmanaged function pointers / Marshal.GetFunctionPointerForDelegate Pin
Luc Pattyn17-Jun-09 9:29
sitebuilderLuc Pattyn17-Jun-09 9:29 
Questionapp domain !!! help please!!! Pin
yams251016-Jun-09 3:33
yams251016-Jun-09 3:33 
AnswerRe: app domain !!! help please!!! Pin
Manas Bhardwaj16-Jun-09 4:01
professionalManas Bhardwaj16-Jun-09 4:01 
AnswerRe: app domain !!! help please!!! Pin
Rob Philpott16-Jun-09 4:55
Rob Philpott16-Jun-09 4:55 
GeneralRe: app domain !!! help please!!! Pin
yams251016-Jun-09 19:05
yams251016-Jun-09 19:05 
QuestionWMI Pin
arkiboys16-Jun-09 3:12
arkiboys16-Jun-09 3:12 
AnswerRe: WMI Pin
Manas Bhardwaj16-Jun-09 3:17
professionalManas Bhardwaj16-Jun-09 3:17 
AnswerRe: WMI Pin
Luc Pattyn16-Jun-09 3:17
sitebuilderLuc Pattyn16-Jun-09 3:17 
GeneralRe: WMI Pin
arkiboys16-Jun-09 3:30
arkiboys16-Jun-09 3:30 
AnswerRe: WMI Pin
Nagy Vilmos16-Jun-09 3:21
professionalNagy Vilmos16-Jun-09 3:21 
GeneralRe: WMI Pin
Luc Pattyn16-Jun-09 3:37
sitebuilderLuc Pattyn16-Jun-09 3:37 
GeneralRe: WMI Pin
Nagy Vilmos16-Jun-09 4:03
professionalNagy Vilmos16-Jun-09 4:03 
GeneralRe: WMI Pin
Luc Pattyn16-Jun-09 4:16
sitebuilderLuc Pattyn16-Jun-09 4:16 
GeneralRe: WMI Pin
Nagy Vilmos16-Jun-09 4:19
professionalNagy Vilmos16-Jun-09 4:19 
GeneralRe: WMI Pin
Luc Pattyn16-Jun-09 4:31
sitebuilderLuc Pattyn16-Jun-09 4:31 
QuestionMicrosoft.Office.Interop.Excel problem Pin
michaelgr116-Jun-09 3:07
michaelgr116-Jun-09 3:07 
AnswerRe: Microsoft.Office.Interop.Excel problem Pin
stancrm16-Jun-09 3:28
stancrm16-Jun-09 3:28 
GeneralRe: Microsoft.Office.Interop.Excel problem Pin
michaelgr116-Jun-09 4:36
michaelgr116-Jun-09 4:36 
GeneralRe: Microsoft.Office.Interop.Excel problem Pin
michaelgr116-Jun-09 6:58
michaelgr116-Jun-09 6:58 
GeneralRe: Microsoft.Office.Interop.Excel problem Pin
MumbleB16-Jun-09 7:55
MumbleB16-Jun-09 7:55 
GeneralRe: Microsoft.Office.Interop.Excel problem Pin
michaelgr117-Jun-09 6:45
michaelgr117-Jun-09 6:45 

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.