C + + DLL export function two methods (export ordinal that way, others do not see the function name)

Source: Internet
Author: User

The first is to directly export the function name as follows code:

#ifdef__cplusplus

#define TEXPORT extern "C" _declspec (dllexport)

#dlse

#define Texport _declspec (dllexport)

Texport BOOL Fun ();//This is to export the function

This method sees the name of the function when it looks at the DLL.

The second type is the following code for the export sequence number:

BOOL _stdcall fun ();

In the project right-click Add New project Point module definition file. Def

Write in def file

LIBRARY "DLL Name"

Exports

Fun @1 NONAME

Such exported functions will not see the function name. Note that the sequence number is to be written sequentially.

Defines the # define # Texport _declspec (dllimport) in the file that is called when the function is exported in the DLL sequence.

The other calls are the same.

http://blog.csdn.net/yjwffgip456/article/details/18702547

C + + DLL export function two methods (export ordinal that way, others do not see the function name)

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.