Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Let’s get you started on your first DLL:
Templates, selectWin32 Project.Application Type(In theApplication Settingstab).Empty Projectand pressFinish.You need to attach an empty source file to the blank project:
Source Files, Add -> Add New Item and then selectC++ Fileand give the name to it.Open.In the opened window, enter the following code:
__declspec(dllexport)is an obligatory prefix which makes DLL functions available from an external application.extern “C”(with braces, for scoping) shows that all code within brackets is available from “outside” the file. Although code will compile even without this statement, during runtime, you will get an error. (I leave this as an experiment for you).Build this application and your DLL file is ready.
Refer to Walkthrough: Creating and Using a Dynamic Link Library for more information on how to do addition and stuff.