Copyright © tutorialspoint.com
First we construct our good old DLL. Choose File->New, then select DLL Wizard. There are some options to set: Let the source be C++, don't use VCL, don't use Multi Threading, use VC++ Style DLL. Enter the source
Save the project as "DLLproj"; save the source file as "MyMax". Then build the project, e.g. using CTRL-F9. You can't run the project because there is no main, so pressing F9 will result in an error. Now we need a main project to call the DLL. Start a new Console application (File->New, choose Console Wizard). No need to include support for VCL or Mutli Threading. Then enter the source:
Next, include the DLL in the project (Project->Add to Project). It is the .lib file (DLLproj.lib) that you need to include. Save the project. Then build the project and watch the fun begin. (To see the results, you probably need to run it from a DOS prompt). |
Copyright © tutorialspoint.com