473,385 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Importing C Function

Dan
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!
Nov 16 '05 #1
2 1313
Dan,

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

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dan" <Da*@discussions.microsoft.com> wrote in message
news:D2**********************************@microsof t.com...
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!
Nov 16 '05 #2
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" <Da*@discussions.microsoft.com> wrote in message
news:D2**********************************@microsof t.com...
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!
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: python | last post by:
I'm writing a function and it needs to use regular expressions and the super-fantastic mx.DateTime module. The first lines after the doc string in the function are: import re, mx.DateTime ...
11
by: Jeff Wagner | last post by:
I am importing a file which contains a persons name (firstName, middleName, etc). If I define a function to do this, how can I use the variables outside of that function? Here is the code: ...
1
by: J. Kenney | last post by:
Good Morning, Is there a way for a function called within an _imported_ library to call back to _calling_ python program to run a function? (Shown below) Also can you overload the print...
3
by: Halvdan Friis | last post by:
Hi, I've run into a problem with exporting and importing a function from a DLL. Hopefully somebody here can tell me how this should be done properly. My DLL function is as follows: void...
7
by: Darren | last post by:
I have been attempting to create a reservation planning form in excel that imports Data from an Access database and inserts that information automaticly into the correct spreed sheet and the...
3
by: Mark | last post by:
All, As you can see below, I have had problems with inquisitive souls looking at data they shouldn't be. I though disabling the ability to create new databases using my workgroup would stop this...
5
by: dixie | last post by:
If I sent a user an empty database container - dB with no tables and I needed them to import their tables into it and one of their tables was a hidden table with the prefix Usys, is there any way...
7
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte...
5
by: BeruthialsCat | last post by:
First go with trying to import xml to a database and whilst i have managed to do what i want i find that the xml files we have here at work are gonna cause me problems. I have a function that...
12
by: JMO | last post by:
I can import a csv file with no problem. I can also add columns to the datagrid upon import. I want to be able to start importing at the 3rd row. This will pick up the headers necessary for the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.