vs2015 create dll and call dll

First create your own dll file:
(1) Insert picture description here
(2) Insert picture description here
(3) Create a new .h file and .cpp file and a module definition inquiry (.def)
Insert picture description here
where the content of the .h file is:
Insert picture description here
.cpp file content is:
Insert picture description here
(4 ) Click Generate Solution to get dll file and lib file

Call the dll file created by yourself
(1) Create a new win32 console application
(2) Configure your dll file path, corresponding lib path, and corresponding header file path in sequence as shown below:
Configure the dll path and
Insert picture description hereInsert picture description here
configure the lib file Path The path
Insert picture description here
Insert picture description here
where the configuration header file is located:
Insert picture description here
linker input (ie enter the name of your lib file):
Insert picture description here
(3) call your dll function in the main function:
Insert picture description here

Published 36 original articles · won praise 1 · views 6384

Guess you like

Origin blog.csdn.net/qq_34291583/article/details/100131930