#1
| |||
| |||
Create a DLL in c++ I work on a project in VC + + and I'd like to use that DLL in another project. My problem is that the creation of DLLs in all the documents of c program but no creation of dll with classes. How to create a DLL while keeping the appearance Object Oriented for generic classes. |
#2
| |||
| |||
Re: Create a DLL in c++ Create a new project "Dynamic Linked Library" (or is it under VS + +). Otherwise, it's the same thing with a normal project, except that there is no macro to the name of each class that you exported (generated automatically by VS) Code: NOMDELADLL_SHARED_EXPORT class ClassName |
#3
| |||
| |||
Re: Create a DLL in c++ DLLs make your program modular, The file formats for DLLs are the same as for Windows EXE files.Microsoft Visual C++ (MSVC) provides a number of extensions to standard C++ which allow functions to be specified as imported or exported directly in the C++ code.In fact once you've created your DLL, it should be placed in the directory of your executable and the "linker" to use it in your program. |
#4
| |||
| |||
Re: Create a DLL in c++ Code: # define COMPTEUR_EXPORTS # include "stdafx.h" # include "Compteur.h" # include "time.h" / / This is the constructor of a class that has been exported. / / See Compteur.h for the class definition COMPTEUR_API CComputer: CComputer () : c (0) ( ) COMPTEUR_API CComputer:: startTime () ( while (1) ( int secElapsed = clock (); if (secElapsed% 10 == 0) c + +; ) ) COMPTEUR_API int CComputer:: getc () ( return c; ) COMPTEUR_API CComputer:: G & C (int _c) ( c = _c; ) |
![]() |
|
Tags: dll, program, vc |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to create XSL in XML | CRiley | Software Development | 5 | 17-02-2010 03:06 AM |
Create PDF in MAC OS X | Elieis | Windows Software | 5 | 09-01-2010 02:16 AM |
How to create your own DVD | TechyGuy | Guides & Tutorials | 6 | 02-10-2009 06:35 PM |
How to create an mp3 cd | kanchu | Windows Software | 3 | 29-07-2009 03:30 PM |
How to create ftp in iis | attitude.ashwin | Networking & Security | 3 | 13-07-2009 06:38 PM |