locked
To call a function from C dll

    Question

  • Hi,

    How do we call a function from a C dll inside .net

    Thursday, February 04, 2010 6:13 AM

All replies

  • Hi Shashank,

    Please supply the following information for further discussion:

    1. Give out the function definition and structure definition in C language.

    2. Give the succeeded VB6 code sample about how to call this DLL in VB6.

    3. Give out the detailed error message.

    Based on your post, I would think that the passed data made the heap corrupted.


    Best regards,
    Riquel
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, February 05, 2010 6:35 AM
    Moderator
  • Please try to use this tool to generate the .NET managed signature for C function and that structure type.
    http://blogs.msdn.com/vbteam/archive/tags/PInvoke/Jared+Parsons/default.aspx
    Best regards,
    Riquel
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, February 08, 2010 3:21 AM
    Moderator
  • The link seems to be fine to me. Below is a more direct link:

    http://blogs.msdn.com/b/vbteam/archive/2008/03/14/making-pinvoke-easy.aspx

     


    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Proposed as answer by Riquel I'm Tuesday, November 02, 2010 2:11 AM
    Monday, October 25, 2010 4:36 PM
  • Paul, "Is the link expired" is one of the common phrases used by hidden link seo spammers. These spammers do not understand technical questions so they use vargue words that fit every forum.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Tuesday, January 25, 2011 2:46 AM