Importing C Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am attempting to use a function written in C and complied to a C dll in my C# project. The function I am attempting to call returns an integer value and takes, as an input parameter, a value of type IACLIENT. In the header file for this function IACLIENT is defined as follows:

typedef void NEARPTR * IACLIENT

The problem I have is in trying to determine how to translate the C type into C#. I am not familiar with the term NEARPTR and I was not able to find any information via google. Any help is appreciate. Thanks!
 
Dan,

It looks to me that you should use IntPtr for types of IACLIENT.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Dan said:
I am attempting to use a function written in C and complied to a C dll in
my C# project. The function I am attempting to call returns an integer value
and takes, as an input parameter, a value of type IACLIENT. In the header
file for this function IACLIENT is defined as follows:
typedef void NEARPTR * IACLIENT

The problem I have is in trying to determine how to translate the C type
into C#. I am not familiar with the term NEARPTR and I was not able to find
any information via google. Any help is appreciate. Thanks!
 
Dan,

Go through the enum list of System.Runtime.InteropServices.UnmanageType

and as well go through static methods of unmanage conversion class
System.Runtime.InteropServices.Marshal

Shak.


Dan said:
I am attempting to use a function written in C and complied to a C dll in
my C# project. The function I am attempting to call returns an integer value
and takes, as an input parameter, a value of type IACLIENT. In the header
file for this function IACLIENT is defined as follows:
typedef void NEARPTR * IACLIENT

The problem I have is in trying to determine how to translate the C type
into C#. I am not familiar with the term NEARPTR and I was not able to find
any information via google. Any help is appreciate. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top