Click here to Skip to main content
15,924,828 members
Home / Discussions / C#
   

C#

 
QuestionA question related to Computers connection using C# Pin
CoderForEver16-Aug-09 10:11
CoderForEver16-Aug-09 10:11 
AnswerRe: A question related to Computers connection using C# Pin
Saksida Bojan16-Aug-09 11:03
Saksida Bojan16-Aug-09 11:03 
GeneralRe: A question related to Computers connection using C# Pin
CoderForEver16-Aug-09 21:54
CoderForEver16-Aug-09 21:54 
GeneralRe: A question related to Computers connection using C# Pin
Saksida Bojan16-Aug-09 23:43
Saksida Bojan16-Aug-09 23:43 
GeneralRe: A question related to Computers connection using C# Pin
Henry Minute17-Aug-09 0:59
Henry Minute17-Aug-09 0:59 
GeneralRe: A question related to Computers connection using C# Pin
CoderForEver17-Aug-09 8:33
CoderForEver17-Aug-09 8:33 
QuestionMore marshaling woes :-( Pin
DaveyM6916-Aug-09 8:48
professionalDaveyM6916-Aug-09 8:48 
AnswerRe: More marshaling woes :-( Pin
Luc Pattyn16-Aug-09 8:58
sitebuilderLuc Pattyn16-Aug-09 8:58 
Hi Dave,

sorry for the delay. Laugh | :laugh:

I haven't done this with a variable length array, I have some experience with ByValArray for fixed lengths, with SizeConst.

What you always can do is forget about the struct, just allocate an actual array (either int or uint, whatever suits best) with the right element count to contain the three individuals and the embedded array.
Then use GCHandle to pin it and get its IntPtr, and pass that. That is the way that always works, and never copies any data. BTW: don't forget to free the GCHandle when done.

I hope the native side will somehow figure out the length of the embedded array, and not read/write outside it.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: More marshaling woes :-( Pin
DaveyM6916-Aug-09 9:51
professionalDaveyM6916-Aug-09 9:51 
GeneralRe: More marshaling woes :-( Pin
Luc Pattyn16-Aug-09 10:33
sitebuilderLuc Pattyn16-Aug-09 10:33 
GeneralRe: More marshaling woes :-( Pin
DaveyM6917-Aug-09 0:46
professionalDaveyM6917-Aug-09 0:46 
GeneralRe: More marshaling woes :-( Pin
Luc Pattyn17-Aug-09 1:13
sitebuilderLuc Pattyn17-Aug-09 1:13 
GeneralRe: More marshaling woes :-( Pin
DaveyM6917-Aug-09 1:50
professionalDaveyM6917-Aug-09 1:50 
AnswerRe: More marshaling woes :-( Pin
Hristo-Bojilov16-Aug-09 9:04
Hristo-Bojilov16-Aug-09 9:04 
GeneralRe: More marshaling woes :-( Pin
DaveyM6916-Aug-09 10:03
professionalDaveyM6916-Aug-09 10:03 
GeneralAdditional information Pin
Pete O'Hanlon16-Aug-09 10:22
mvePete O'Hanlon16-Aug-09 10:22 
GeneralRe: Additional information Pin
Luc Pattyn16-Aug-09 10:38
sitebuilderLuc Pattyn16-Aug-09 10:38 
GeneralRe: Additional information Pin
Pete O'Hanlon16-Aug-09 10:41
mvePete O'Hanlon16-Aug-09 10:41 
GeneralRe: Additional information Pin
DaveyM6916-Aug-09 10:52
professionalDaveyM6916-Aug-09 10:52 
GeneralRe: Additional information Pin
Pete O'Hanlon16-Aug-09 10:58
mvePete O'Hanlon16-Aug-09 10:58 
GeneralRe: Additional information Pin
Luc Pattyn16-Aug-09 11:14
sitebuilderLuc Pattyn16-Aug-09 11:14 
GeneralRe: Additional information Pin
Pete O'Hanlon16-Aug-09 11:19
mvePete O'Hanlon16-Aug-09 11:19 
GeneralRe: Additional information Pin
DaveyM6916-Aug-09 11:50
professionalDaveyM6916-Aug-09 11:50 
QuestionSelected tab that affect on listbox Pin
tamir90116-Aug-09 8:15
tamir90116-Aug-09 8:15 
AnswerRe: Selected tab that affect on listbox Pin
tamir90116-Aug-09 9:38
tamir90116-Aug-09 9:38 

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.