CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2001
    Posts
    29

    How to call DLL compiled by VC 6.0 by C#?

    I have a DLL which was compiled with VC 6.0.
    Can I call that DLL with C#?
    Thanks!


  2. #2
    Join Date
    Mar 2002
    Posts
    174

    Re: How to call DLL compiled by VC 6.0 by C#?

    You must include in your project System.Runtime.InteropServices.

    Sample:

    [DllImport("yourDll")]
    public static extern int Function(int hWnd,....)

    public static int Main()
    {
    Function(10);
    }




    Can you retrieve on MSDM documentation about Platform Invoke.

    Good luck
    Please rate if you think this response was useful for you.
    Have more questions?


  3. #3
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    170

    Exclamation Importing c++ data types

    Hi all. I am trying to import a c++ dll, but the compiler doesn't understand the user defined c++ data types being passed into and returned from the c++ function. How do I import user defined c++ data types?

    for example:

    [DllImport("myvsdll.dll")]
    static extern USERTYPE* process(USERDATA* udata);


    compiler says USERTYPE and USERDATA can not be found.

    Thanks!
    I am scifi

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