How do I use structures declared in C header files in my C# project?

S

Stefan

How do I use structures declared in C header files in my
C# project?

It should be an easy problem to solve but I just cannot
find any information help on the subject. I have several
pages of declarations (mostly of different structs) in
those header C files and I do not want to rewrite them. Is
it possible to add them as unmanaged code in my C# project?

Basically I am trying to incoporate and use the different
structures and methods I have already written in C.

// Stefan
 
A

Alex Feinman [MVP]

If you are willing to spend $40-60 take a look here:
http://www.paulyao.com/resources/tools/Pinvokewiz.htm
Paul Yao's team has written a wizard that is supposed to be good exactly for
what you are trying to do - converting structs. Don't exepct any magic
though. If your structs contain embedded arrays or structure pointers - you
will have to do it by hand
 
S

Stefan

Too bad..

Thanks anyway,

Stefan
-----Original Message-----
If you are willing to spend $40-60 take a look here:
http://www.paulyao.com/resources/tools/Pinvokewiz.htm
Paul Yao's team has written a wizard that is supposed to be good exactly for
what you are trying to do - converting structs. Don't exepct any magic
though. If your structs contain embedded arrays or structure pointers - you
will have to do it by hand




.
 

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

Top