C # Calling a function method in an unmanaged dynamic library

Source: Internet
Author: User

C # How to invoke a function in an unmanaged dynamic library, such as a dynamic library written with VC6, the process of calling a dynamic library in C # is much easier and quicker than Java calling DLL dynamic libraries, as illustrated below.


1. Create an unmanaged dynamic library

The code is as follows:


The code is as follows:


This sentence declares that the dynamic library outputs a function prototype that is not callable.

extern "C" __declspec (dllexport) int add (int, int);

int add (int a, int b)

{

Implement this function returna+b;

}

In addition to the Declaration, Running GuestArticles are original, reproduced please link to the form of the address of this article
C # Calling a function method in an unmanaged dynamic library

This address: http://www.paobuke.com/develop/c-develop/pbk23137.html






Related content conversion of several formats of C # serialization and deserialization C # parsing the LRC lyrics file process to differentiate between WCF and WebService, advantages C # Super Practical Code Snippet Collection
C # accumulator Function aggregate Usages example C # method of averaging, variance, and normal distribution using random numbers of randomness extern external method using C # Implementation Method C # Singleton mode (Singleton pattern) Example Tutorial

C # Calling a function method in an unmanaged dynamic library

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.