473,394 Members | 1,817 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,394 software developers and data experts.

translating C++ library to C#

I'm trying to use the library in c++ by using [DllImport("library.dll")] but
it requires some specific structures and macros:

#define gg_common_head(x) \

int fd; /* podgl?dany deskryptor */ \

int check; /* sprawdzamy zapis czy odczyt */ \

int state; /* aktualny stan maszynki */ \

int error; /* kod błędu dla GG_STATE_ERROR */ \

int type; /* rodzaj sesji */ \

int id; /* identyfikator */ \

int timeout; /* sugerowany timeout w sekundach */ \

int (*callback)(x*); /* callback przy zmianach */ \

void (*destroy)(x*); /* funkcja niszczenia */

I have problem with this macro, how should it write in C# ? And one more
question... If in c++ structure is defined in this way:

struct some_struct {

int a;

char * b;

struct another_struct;

}

can I replace this ???

struct some_struct {

int a;

IntPtr b;

struct another_struct;

}

Sorry about my english.

Best regards,

Winthux
Nov 15 '05 #1
0 907

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

Similar topics

13
by: cjl | last post by:
Hey all: I'm working on a 'pure' python port of some existing software. Implementations of what I'm trying to accomplish are available (open source) in C++ and in Java. Which would be...
2
by: calin.hanchevici | last post by:
Hi all, I have a C++ library I call from python. The problem is I have c++ exceptions that i want to be translated to python. I want to be able to do stuff like: try: my_cpp_function() except...
1
by: Michael Friendly | last post by:
I have a LaTeX document describing a long list of items that I want to translate to XML to treat these as a database. I've written a perl script to do the basic translation, and a basic DTD file,...
12
by: Charles Law | last post by:
Hi guys A bit of curve ball here ... I have a document (Word) that contains a series of instructions in sections and subsections (and sub-subsections). There are 350 pages of them. I need to...
3
by: Jon Maz | last post by:
Hi All, Am getting frustrated trying to port the following (pretty simple) function to CSharp. The problem is that I'm lousy at Regular Expressions.... //from...
3
by: Gabe Covert | last post by:
I'm a new C# developer, and am developing an application which will utilize a COM library from a third party. I have two following SDK calls from the 3rd-party SDK which I can't get to work under...
1
by: J | last post by:
Hi all, I just finished a asp.net project, which is based on English language, and all of sudden, client need different language also, say German, Chinese, etc. So, what is the best way, or I...
16
by: Spiros Bousbouras | last post by:
There are several compilers which accept various extensions to the C language and produce native code. But I wonder if there are any which offer the option to translate from C with some extensions...
1
by: trihaitran | last post by:
Hi I am new to Ruby from Python and am still learning some stuff. I have a Ruby program that uses the mechanize library to connect to a Web site and authenticate with a username and password. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.