Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 26-10-2009
Member
 
Join Date: Apr 2009
Posts: 87
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.
Reply With Quote
  #2  
Old 26-10-2009
Member
 
Join Date: May 2008
Posts: 2,293
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
Reply With Quote
  #3  
Old 26-10-2009
Member
 
Join Date: Jan 2009
Posts: 199
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.
Reply With Quote
  #4  
Old 26-10-2009
Member
 
Join Date: Dec 2008
Posts: 177
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; 
)
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Create a DLL in c++"
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


All times are GMT +5.5. The time now is 05:08 PM.