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

C#

 
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 
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 
Hi,

1.
myInt.ToString("X8") turns an int into an 8-digit hex string;
and File.AppendAllText(filename,text) appends some text to a new or existing file
(there are faster ways with File.AppendText if lots of texts need appended).

2.
There are two explicit ways to get a pointer (to array or some other object); one is with the fixed keyword, the other with GCHandle, like so:

int dim=1000;
int[] numbers=makeIntArray(dim);
GCHandle handle=GCHandle.Alloc(numbers, GCHandleType.Pinned);
int sum=SumArray(handle.AddrOfPinnedObject(), dim);
handle.Free();

	[DllImport("NativeC.dll")]
	public static extern int SumArray(IntPtr pNumbers, int count);


3.
You do have native code that successfully calls the native lib, you said?
so you can read the calling code and understand exactly how it needs to be called, e.g. who is allocating the array.
If unclear, you could post some of that too.

Smile | :)

Luc Pattyn

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


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 
GeneralRe: Marshaling between managed and unmanaged Pin
akhanal29-Sep-09 6:27
akhanal29-Sep-09 6:27 
QuestionGetting the selected items from a radioButton group Pin
Twyce28-Sep-09 6:42
Twyce28-Sep-09 6:42 
AnswerRe: Getting the selected items from a radioButton group Pin
Michael Eber28-Sep-09 7:04
Michael Eber28-Sep-09 7:04 
QuestionCrystal Report at User's Computer Pin
Said Ali Jalali28-Sep-09 5:05
Said Ali Jalali28-Sep-09 5:05 
AnswerRe: Crystal Report at User's Computer Pin
Not Active28-Sep-09 5:12
mentorNot Active28-Sep-09 5:12 
AnswerRe: Crystal Report at User's Computer Pin
hosseinghazanfary28-Sep-09 6:08
hosseinghazanfary28-Sep-09 6:08 

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.