how use windbase.h at C#

1.7k views Asked by At

after long time of reading on google I still don't know how can I work with this EDB http://msdn.microsoft.com/en-us/library/aa912256 at C#. I read a lot of about wrapers and SWIG solution. But how can I wrap functions which are at windbase.h.

I want to make EDB in my c# program. Can I make some way dll from <.h>?

1

There are 1 answers

0
vlkpo On BEST ANSWER

After some effort I think now, it is not good idea try to use windbase.h in C#. There are great and useful articles about P/invok. Just write "Call Unmanaged DLLs from C#" to google. One of best for me was:

http://msdn.microsoft.com/en-us/magazine/cc301501.aspx

But because our unmanaged function requires a structure as a parameter, the structure needs to be defined in the managed code as well as in the unmanaged code. In other words, it is needed to rewrite all structures and constants and stuffs to c#. And there are also other dependencies on windbase_edb.h, winnt.h, windef.h, winbase.h...

From my point of view it is too difficult way. Or it can be done differently?