Click here to Skip to main content
15,894,343 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to generate Dynamic buttons in C# from Database Values? Pin
Mycroft Holmes23-Jan-16 20:13
professionalMycroft Holmes23-Jan-16 20:13 
GeneralRe: How to generate Dynamic buttons in C# from Database Values? Pin
Member 1224271723-Jan-16 20:25
Member 1224271723-Jan-16 20:25 
GeneralRe: How to generate Dynamic buttons in C# from Database Values? Pin
Mycroft Holmes23-Jan-16 20:30
professionalMycroft Holmes23-Jan-16 20:30 
Questionhow to implement this code for multiple clients using c sharp Pin
Member 1061979722-Jan-16 22:32
Member 1061979722-Jan-16 22:32 
AnswerRe: how to implement this code for multiple clients using c sharp Pin
OriginalGriff22-Jan-16 23:01
mveOriginalGriff22-Jan-16 23:01 
QuestionRe: how to implement this code for multiple clients using c sharp Pin
Paul Conrad23-Jan-16 6:00
professionalPaul Conrad23-Jan-16 6:00 
GeneralRe: how to implement this code for multiple clients using c sharp Pin
PIEBALDconsult23-Jan-16 6:13
mvePIEBALDconsult23-Jan-16 6:13 
GeneralRe: how to implement this code for multiple clients using c sharp Pin
PIEBALDconsult23-Jan-16 6:16
mvePIEBALDconsult23-Jan-16 6:16 
GeneralRe: how to implement this code for multiple clients using c sharp Pin
Richard Andrew x6423-Jan-16 9:21
professionalRichard Andrew x6423-Jan-16 9:21 
GeneralRe: how to implement this code for multiple clients using c sharp Pin
PIEBALDconsult23-Jan-16 9:24
mvePIEBALDconsult23-Jan-16 9:24 
AnswerSimple answer: add an header before data Pin
Philippe Mori23-Jan-16 8:21
Philippe Mori23-Jan-16 8:21 
AnswerRe: how to implement this code for multiple clients using c sharp Pin
jschell27-Jan-16 9:18
jschell27-Jan-16 9:18 
Questionautomatic test data generators for C# ? Pin
BillWoodruff21-Jan-16 18:15
professionalBillWoodruff21-Jan-16 18:15 
AnswerRe: automatic test data generators for C# ? Pin
Eddy Vluggen22-Jan-16 6:38
professionalEddy Vluggen22-Jan-16 6:38 
GeneralRe: automatic test data generators for C# ? Pin
BillWoodruff22-Jan-16 13:03
professionalBillWoodruff22-Jan-16 13:03 
GeneralRe: automatic test data generators for C# ? Pin
Eddy Vluggen23-Jan-16 0:55
professionalEddy Vluggen23-Jan-16 0:55 
QuestionICustomMarshaler not returning an Out parameter Pin
mavl21-Jan-16 5:16
mavl21-Jan-16 5:16 
AnswerRe: ICustomMarshaler not returning an Out parameter Pin
Luc Pattyn21-Jan-16 15:18
sitebuilderLuc Pattyn21-Jan-16 15:18 
GeneralRe: ICustomMarshaler not returning an Out parameter Pin
mavl21-Jan-16 23:08
mavl21-Jan-16 23:08 
GeneralRe: ICustomMarshaler not returning an Out parameter Pin
Luc Pattyn22-Jan-16 4:40
sitebuilderLuc Pattyn22-Jan-16 4:40 
GeneralRe: ICustomMarshaler not returning an Out parameter Pin
mavl22-Jan-16 8:58
mavl22-Jan-16 8:58 
GeneralRe: ICustomMarshaler not returning an Out parameter Pin
Luc Pattyn22-Jan-16 9:10
sitebuilderLuc Pattyn22-Jan-16 9:10 
GeneralRe: ICustomMarshaler not returning an Out parameter Pin
mavl22-Jan-16 23:15
mavl22-Jan-16 23:15 
GeneralRe: ICustomMarshaler not returning an Out parameter Pin
Luc Pattyn23-Jan-16 0:43
sitebuilderLuc Pattyn23-Jan-16 0:43 
GeneralRe: ICustomMarshaler not returning an Out parameter Pin
mavl23-Jan-16 2:49
mavl23-Jan-16 2:49 
1. Thanks for the links.

3. Already done as I replied to Gerry.

2. I don't want to make ref IntPtr, Marshal does that and I don't want it.
When using my ICustomMarshaler and sending pDataOut as normal, so no ref or out, the MarshalNativeToManaged works fine, just the result doesn't get used because I don't send pDataOut as ref or out.
If you then change the pDataOut to a ref, the MarshalNativeToManaged fails. Why? Because the IntPtr coming in to the method actually contains the dwLength, the amount of bytes, the first field of the struct. This can only happen when Marshal sends the IntPtr as ref, and the native code expects a pointer to the struct, not a pointer to the pointer. So it overwrites the IntPtr with the first field, and it overwrites the next 4 or 8 bytes (32 or 64 bit) with the pointer to the bytes. This last thing is actually memory corruption.

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.