Click here to Skip to main content
15,892,965 members
Home / Discussions / C#
   

C#

 
GeneralRe: PInvoke, varaible length arrays Pin
Pete O'Hanlon14-Aug-09 11:57
mvePete O'Hanlon14-Aug-09 11:57 
GeneralRe: PInvoke, varaible length arrays Pin
DaveyM6914-Aug-09 12:15
professionalDaveyM6914-Aug-09 12:15 
AnswerRe: PInvoke, varaible length arrays Pin
Luc Pattyn14-Aug-09 11:46
sitebuilderLuc Pattyn14-Aug-09 11:46 
GeneralRe: PInvoke, varaible length arrays Pin
Pete O'Hanlon14-Aug-09 11:54
mvePete O'Hanlon14-Aug-09 11:54 
GeneralRe: PInvoke, varaible length arrays Pin
Luc Pattyn14-Aug-09 11:56
sitebuilderLuc Pattyn14-Aug-09 11:56 
GeneralRe: PInvoke, varaible length arrays Pin
Pete O'Hanlon14-Aug-09 11:59
mvePete O'Hanlon14-Aug-09 11:59 
GeneralRe: PInvoke, varaible length arrays Pin
Luc Pattyn14-Aug-09 12:03
sitebuilderLuc Pattyn14-Aug-09 12:03 
GeneralRe: PInvoke, varaible length arrays [Solved] Pin
DaveyM6914-Aug-09 12:09
professionalDaveyM6914-Aug-09 12:09 
eventSize is actually 12 * number of elements. The Marshal.SizeOf(ev) was there from previously attempted code and is now redundant - sorry about that.

Luc Pattyn wrote:
[4] treats eventSize as if it were the size of a single element, which it isn't


Confused | :confused: Not sure what you mean here. I'm trying to Marshal element[i] into the next block of bytes reserved by [2], so if there were three elements, [2] would reserve 36 bytes. On the first iteration, element 1 will go to where eventPointer is pointing, on the second eventPointer + 12, on the third eventPointer + 24.

Oops - you're right. eventSize is the size of all events, not an individual. Changing that in [4] fixed it!

Thanks guys. Thumbs Up | :thumbsup:

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: PInvoke, varaible length arrays [Solved] Pin
Luc Pattyn14-Aug-09 12:17
sitebuilderLuc Pattyn14-Aug-09 12:17 
GeneralRe: PInvoke, varaible length arrays [Solved] Pin
DaveyM6914-Aug-09 12:54
professionalDaveyM6914-Aug-09 12:54 
GeneralRe: PInvoke, varaible length arrays [Solved] Pin
Luc Pattyn14-Aug-09 13:01
sitebuilderLuc Pattyn14-Aug-09 13:01 
GeneralRe: PInvoke, varaible length arrays [Solved] Pin
DaveyM6914-Aug-09 13:08
professionalDaveyM6914-Aug-09 13:08 
GeneralRe: PInvoke, varaible length arrays [Solved] Pin
DaveyM6921-Apr-10 10:38
professionalDaveyM6921-Apr-10 10:38 
AnswerRe: PInvoke, varaible length arrays Pin
Hristo-Bojilov14-Aug-09 12:15
Hristo-Bojilov14-Aug-09 12:15 
GeneralRe: PInvoke, varaible length arrays Pin
DaveyM6914-Aug-09 12:20
professionalDaveyM6914-Aug-09 12:20 
GeneralRe: PInvoke, varaible length arrays [modified] Pin
Hristo-Bojilov14-Aug-09 12:33
Hristo-Bojilov14-Aug-09 12:33 
QuestionUpdate db table Linq Pin
spankyleo12314-Aug-09 10:05
spankyleo12314-Aug-09 10:05 
AnswerCross posted from the LINQ forum Pin
Pete O'Hanlon14-Aug-09 10:33
mvePete O'Hanlon14-Aug-09 10:33 
GeneralRe: Cross posted from the LINQ forum Pin
spankyleo12314-Aug-09 10:39
spankyleo12314-Aug-09 10:39 
GeneralRe: Cross posted from the LINQ forum Pin
Pete O'Hanlon14-Aug-09 10:54
mvePete O'Hanlon14-Aug-09 10:54 
QuestionError handling for WMI queries [Solved] Pin
eeffoc4214-Aug-09 9:32
eeffoc4214-Aug-09 9:32 
AnswerRe: Error handling for WMI queries Pin
Saksida Bojan14-Aug-09 9:47
Saksida Bojan14-Aug-09 9:47 
AnswerRe: Error handling for WMI queries Pin
Luc Pattyn14-Aug-09 9:48
sitebuilderLuc Pattyn14-Aug-09 9:48 
AnswerRe: Error handling for WMI queries [modified] Pin
Hristo-Bojilov14-Aug-09 10:18
Hristo-Bojilov14-Aug-09 10:18 
QuestionComparing files on another computer. Pin
murktinez14-Aug-09 8:03
murktinez14-Aug-09 8:03 

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.