Results 1 to 4 of 4

Thread: Create a DLL in c++

  1. #1
    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.

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    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. #3
    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.

  4. #4
    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; 
    )

Similar Threads

  1. How to create XSL in XML
    By CRiley in forum Software Development
    Replies: 5
    Last Post: 17-02-2010, 03:06 AM
  2. Create PDF in MAC OS X
    By Elieis in forum Windows Software
    Replies: 5
    Last Post: 09-01-2010, 02:16 AM
  3. How to create your own DVD
    By TechyGuy in forum Guides & Tutorials
    Replies: 6
    Last Post: 02-10-2009, 06:35 PM
  4. How to create an mp3 cd
    By kanchu in forum Windows Software
    Replies: 3
    Last Post: 29-07-2009, 03:30 PM
  5. How to create ftp in iis
    By attitude.ashwin in forum Networking & Security
    Replies: 3
    Last Post: 13-07-2009, 06:38 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,716,430,891.45222 seconds with 16 queries