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

C#

 
AnswerRe: IPicture to byte[] Pin
Rob Philpott16-Jun-09 4:47
Rob Philpott16-Jun-09 4:47 
GeneralRe: IPicture to byte[] Pin
Sander123432116-Jun-09 4:50
Sander123432116-Jun-09 4:50 
GeneralRe: IPicture to byte[] Pin
Rob Philpott16-Jun-09 4:57
Rob Philpott16-Jun-09 4:57 
AnswerRe: IPicture to byte[] Pin
0x3c016-Jun-09 8:58
0x3c016-Jun-09 8:58 
QuestionUnmanaged function pointers / Marshal.GetFunctionPointerForDelegate Pin
DaveyM6916-Jun-09 3:57
professionalDaveyM6916-Jun-09 3:57 
AnswerRe: Unmanaged function pointers / Marshal.GetFunctionPointerForDelegate Pin
Luc Pattyn16-Jun-09 4:27
sitebuilderLuc Pattyn16-Jun-09 4:27 
GeneralRe: Unmanaged function pointers / Marshal.GetFunctionPointerForDelegate Pin
DaveyM6916-Jun-09 4:54
professionalDaveyM6916-Jun-09 4:54 
GeneralRe: Unmanaged function pointers / Marshal.GetFunctionPointerForDelegate Pin
DaveyM6916-Jun-09 13:25
professionalDaveyM6916-Jun-09 13:25 
Just a quick follow up Luc...

The delegate is a parameter in an Open function. To keep the instance alive, I have a private static list of open devices and the instance is added to that.

The callbacks can keep coming until the Close function is called. When closing, I'm removing the instance from the static list. I've also implemented the Dispose pattern on the device instances and if any are open when Dispose is called, the Close function is called. Doing it this way seems to remove the need for any pinning etc.

Is that sufficient in your opinion?

(I haven't managed to call the Close without runtime errors from a finalizer BTW, so if you know a solution to that I'd be glad to hear it! I can post code if you wish).

Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralRe: Unmanaged function pointers / Marshal.GetFunctionPointerForDelegate Pin
Luc Pattyn16-Jun-09 14:10
sitebuilderLuc Pattyn16-Jun-09 14:10 
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 

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.