-3

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>?

vlkpo
  • 199
  • 1
  • 15
  • with P/invoke I am able to call unmanaged DLL functions from C#. but how can I gain something like windbase.dll? – vlkpo Jul 31 '12 at 11:30
  • As far as I know, .h files only contain declarations (therefore the name header file), the definitions are in another file, that is referenced by the .h file ... so in my opinion you cannot convert a .h file into a library, because it is missing the implementations of the functions. – Hinek Jul 31 '12 at 11:54
  • I wrapped the functions at c++ project(body of functions composes only from calling of function from windbase.h) and I created dll. I tried to use this dll at c# code by P/invoke method. Problem is that I have to send to this "dllimported" function parameters which are structures from c++ windbase.h library. I still don't have solution. – vlkpo Aug 09 '12 at 06:40

1 Answers1

0

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?

vlkpo
  • 199
  • 1
  • 15