Click here to Skip to main content
15,888,006 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to mark some rows in datagrid ? Pin
Henry Minute28-Sep-09 10:17
Henry Minute28-Sep-09 10:17 
QuestionDoes anyone know of an recommending tool... Pin
Paw Jershauge28-Sep-09 8:31
Paw Jershauge28-Sep-09 8:31 
AnswerRe: Does anyone know of an recommending tool... Pin
Henry Minute28-Sep-09 9:20
Henry Minute28-Sep-09 9:20 
GeneralRe: Does anyone know of an recommending tool... Pin
Paw Jershauge28-Sep-09 22:01
Paw Jershauge28-Sep-09 22:01 
QuestionMarshaling between managed and unmanaged [modified] Pin
akhanal28-Sep-09 6:47
akhanal28-Sep-09 6:47 
AnswerRe: Marshaling between managed and unmanaged Pin
Luc Pattyn28-Sep-09 7:45
sitebuilderLuc Pattyn28-Sep-09 7:45 
GeneralRe: Marshaling between managed and unmanaged Pin
akhanal28-Sep-09 8:28
akhanal28-Sep-09 8:28 
GeneralRe: Marshaling between managed and unmanaged Pin
Luc Pattyn28-Sep-09 8:48
sitebuilderLuc Pattyn28-Sep-09 8:48 
Hi,

1.
yes it can generate correct results, but it isn't a good habit. And it would go wrong if you did similar things with other type pairs, e.g. float and double. I expect it would also cause problems with arrays. Laugh | :laugh:

2.
AFAIK managed code can't accept an unmanaged array simply by applying a couple of * or & symbols.
This is the only way I know would work:
- declare an IntPtr variable
- accept the pointer as a "ref IntPtr" or "out IntPtr"
- create a managed array of correct size
- use Marshal.Copy to copy the data from the IntPtr (=unmanaged data) to the new, managed array

FYI: I very much prefer the approach where the managed code creates an array, passes it (as a pointer) to the unmanaged side, which fills it; that however is not how your unmanaged code works right now.

Smile | :)

Luc Pattyn

Local announcement (Antwerp region): Lange Wapper? Neen!


GeneralRe: Marshaling between managed and unmanaged Pin
Richard MacCutchan28-Sep-09 9:16
mveRichard MacCutchan28-Sep-09 9:16 
GeneralRe: Marshaling between managed and unmanaged Pin
Luc Pattyn28-Sep-09 9:32
sitebuilderLuc Pattyn28-Sep-09 9:32 
GeneralRe: Marshaling between managed and unmanaged [modified] Pin
akhanal28-Sep-09 9:28
akhanal28-Sep-09 9:28 
GeneralRe: Marshaling between managed and unmanaged [modified] Pin
Luc Pattyn28-Sep-09 9:43
sitebuilderLuc Pattyn28-Sep-09 9:43 
GeneralRe: Marshaling between managed and unmanaged [modified] Pin
akhanal28-Sep-09 10:06
akhanal28-Sep-09 10:06 
GeneralRe: Marshaling between managed and unmanaged Pin
Luc Pattyn28-Sep-09 10:45
sitebuilderLuc Pattyn28-Sep-09 10:45 
GeneralRe: Marshaling between managed and unmanaged Pin
akhanal28-Sep-09 11:03
akhanal28-Sep-09 11:03 
GeneralRe: Marshaling between managed and unmanaged Pin
akhanal28-Sep-09 12:01
akhanal28-Sep-09 12:01 
GeneralRe: Marshaling between managed and unmanaged Pin
Luc Pattyn28-Sep-09 12:18
sitebuilderLuc Pattyn28-Sep-09 12:18 
GeneralRe: Marshaling between managed and unmanaged Pin
akhanal29-Sep-09 4:04
akhanal29-Sep-09 4:04 
GeneralRe: Marshaling between managed and unmanaged Pin
Luc Pattyn29-Sep-09 4:17
sitebuilderLuc Pattyn29-Sep-09 4:17 
GeneralRe: Marshaling between managed and unmanaged [modified] Pin
akhanal29-Sep-09 5:02
akhanal29-Sep-09 5:02 
GeneralRe: Marshaling between managed and unmanaged Pin
Luc Pattyn29-Sep-09 5:36
sitebuilderLuc Pattyn29-Sep-09 5:36 
GeneralRe: Marshaling between managed and unmanaged Pin
akhanal29-Sep-09 5:32
akhanal29-Sep-09 5:32 
GeneralRe: Marshaling between managed and unmanaged Pin
Luc Pattyn29-Sep-09 5:37
sitebuilderLuc Pattyn29-Sep-09 5:37 
GeneralRe: Marshaling between managed and unmanaged [modified] Pin
akhanal29-Sep-09 6:01
akhanal29-Sep-09 6:01 
GeneralRe: Marshaling between managed and unmanaged Pin
Luc Pattyn29-Sep-09 6:15
sitebuilderLuc Pattyn29-Sep-09 6:15 

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.