00:00To export a DLL, Dynamic Link Library in Microsoft Visual Studio using C++, create a Dynamic Link Library project, mark
00:09your functions with EDLS port, and build a solution.
00:12Step 1. Create a new DLL project to open Visual Studio and click on Create a New Project.
00:18To search for, and select Dynamic Link Library DLL or Class Library under C++, choose the template named Dynamic Link
00:25Library DLL for native CKeySus+.
00:28Click Next. Name new project. For example, MyLibrary, choose a location, and click Create.
00:35Step 2. Write the export code, open your header file, for example, mylibrary.h, and use declspec.delexport to expose
00:42functions or classes so other programs can use them.
00:44E-pragma once.
00:45If def mylibrary exports define mylibrary API declspec.delexport, define mylibrary API declspec.delexport, extern c mylibrary API int addend
00:56a int b, use code with caution.
00:59Open your source file, for example, mylibrary.cpf, and implement the function, one-clude mylibrary.h, mylibrary API int addend
01:07a int b a return a plus b, use code with caution.
01:10Make sure the preprocessor definition mylibrary exports is defined in your project's properties.
01:15Under KCC++, preprocessor, preprocessor definitions, Visual Studio often adds this automatically for default DLL templates.
01:25Step 3. Build the solution.
01:26Set your configuration dropdown at the top to release or debug an architecture to x64 or x86.
01:33Go to the top menu and select Build Then Build Solution or press Ctrl plus Shift plus B.
01:40Look at the output window at the bottom to verify the build succeeded.
01:43Step 4. Locate the exported files.
01:45After a successful build, check your project folder, usually inside x64 release or debug folder within your project directory.
01:52You will find three crucial files, mylibrary.dll, the actual binary file containing your executable functions,
01:59mylibrary.lid, the import library required a compile time if you are linking statically or implicitly.
02:04library.h, the header file, defining the interface for whoever consumes the DLL.
02:09Stack overflow, how to export a DLL from Visual Studio 2017 Community Edition C++ project.
02:16How to create DLL files in Visual Studio.
02:19And that's the full picture.
02:20If this saved you a search, hit like and subscribe.
02:23One clear answer, every day.
02:25See you in the next one.