CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2008
    Posts
    2

    [RESOLVED] How can I use C libraries with C#?

    We are currently working on a project, where my friends are writing some data processing code with C (dll). I was told to build a gui and handle the database stuff with C#.NET.
    can i link those libraries to my program and how do i do that?

  2. #2
    Join Date
    Sep 2008
    Posts
    2

    Re: How can I use C libraries with C#?

    You need to have a look at www.pinvoke.net to see examples of DllImport.
    There you can find windows api's function that much signatures method in C#.

    Regards,
    Tom

  3. #3
    Join Date
    Mar 2007
    Posts
    375

    Re: How can I use C libraries with C#?

    Code:
    [DLLImport("dllname.dll")]
    public static extern void functionName(params);
    ...
    functionName(...); //Calling function
    Please vote the posts you find usefull.

    ---

    I'm back
    Bigger and badder
    Better and bolder
    Explaining stuff -
    With an improved vocabulary!

  4. #4
    Join Date
    Sep 2008
    Posts
    2

    Re: How can I use C libraries with C#?

    thanks guys

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured