PC Review


Reply
Thread Tools Rate Thread

C# P/Invoke to pass pointer-to-pointer-to-structure (**pPtr) to C

 
 
=?Utf-8?B?YnJja2Nj?=
Guest
Posts: n/a
 
      30th Nov 2004
I have a function in C which takes a pointer to a pointer to a structure. It
then returns a linked list.

How do I call, via P/Invoke, from C# to C.

struct LinkedList
{
char *value;
struct LinkedList *next;
}

void CreateList(struct LinkedList **pPtr)
{

// creates the linked list

}

How do I call CreateList from C#? I know I need to declare the structure
and then create an instance of this structure, but I can't figure out how to
pass a pointer to a pointer to the structure.

- Bruce

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Void pointer and structure pointer Nasif Microsoft C# .NET 3 20th Jun 2008 05:55 PM
How can i pass structure into c function that expect pointer guy.gorodish@googlemail.com Microsoft C# .NET 2 7th May 2007 12:21 AM
Using P/Invoke to call a pointer to a pointer harter.jim@gmail.com Microsoft C# .NET 1 9th Oct 2006 07:47 PM
P/Invoke for pointer to pointer argument. Can Balioglu Microsoft C# .NET 1 16th Jan 2005 11:15 PM
How to pass pointer to pointer to c function from c# Pravin Microsoft C# .NET 0 28th Aug 2003 05:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:45 AM.