IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Autres éditeurs Discussion :

créér une dll avec borland c++ compiler


Sujet :

Autres éditeurs

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Février 2003
    Messages
    2
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2003
    Messages : 2
    Points : 2
    Points
    2
    Par défaut créér une dll avec borland c++ compiler
    j'aimerais developper une dll avec borland c++ compiler et j'aimerais connaitre la ligne de compilation qui permet de generer le DLL a partir du code c++ et / ou s'il il fo quelleques lignes "speciales" dans le code.

    sous visual on le dis seulement a la creation du projet et y fait tout tout seul

  2. #2
    Membre à l'essai
    Profil pro
    Inscrit en
    Mars 2002
    Messages
    9
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2002
    Messages : 9
    Points : 11
    Points
    11
    Par défaut
    je crois qu'il faut juste compiler avec l'option -tWD ton .c
    autrement dit >bcc32 -tWD monfichier.c

    mais bon, cela reste à confirmer (en tout cas ça marche pour mon .c actuel)

  3. #3
    Inactif  

    Profil pro
    Inscrit en
    Décembre 2002
    Messages
    534
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2002
    Messages : 534
    Points : 403
    Points
    403
    Par défaut Compiler une dll avec Borland C++
    Bonsoir,
    Pour compiler votre .c en DLL 32bits assurer vous que
    avez cette fonction dans votre source
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    BOOL WINAPI DllEntryPoint(HINSTANCE  hinstDLL, DWORD  fdwReason, LPVOID lpvReserved )
      {
        return TRUE ;
      }
    De plus pour des raisons de compatibilité donnez la convention
    d'appel __stdcall

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    par ex :
     BOOL __stdcall _export  strToLdouble( LPCSTR z, long double * val ) ;
    Finallement choisissez le fichier COD32DYN.OBJ comme fichier
    de démarrage
    Cordialement.

  4. #4
    Membre régulier
    Profil pro
    Inscrit en
    Mars 2002
    Messages
    92
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2002
    Messages : 92
    Points : 84
    Points
    84
    Par défaut
    dj.motte, ce sont tu parles m'intéresse beaucoup. As-tu un lien ou une documentation qui explique à quoi sert ces déclarations de fonctions et s'il y a d'autre(s) fonction(s) ou constante(s) à déclarer pour implémenter une DLL correctement??

  5. #5
    Inactif  

    Profil pro
    Inscrit en
    Décembre 2002
    Messages
    534
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2002
    Messages : 534
    Points : 403
    Points
    403
    Par défaut Creation de DLL avec Borland C++
    Bonsoir,
    PRECONDITIONS
    -Vous utilisez Win9x ou plus.
    -Vous utilisez Borland C++ 5.0 ou ultérieur
    -Les exemples qui suivent s'appliquent à Borland C++ 5.01 ou 5.02
    pas à CBuilder.
    FIN des PRECONDITIONS

    Pour se faire une idée de la programmations des DLL en C 32bits
    consulter mon message précédent.
    (Pas d'autres fonctions ni constantes sont nécéssaires ) .

    Pour informations sur les DLL compatibles Delphi, Borland C++, Visual
    C++, Visual Basic 4.0 .
    Calling 32-bit DLL's built with Borland C++ from non-BC Apps

    Currently, Borland C++ supports calling a DLL compiled with Borland C++ from
    applications created with other tools only if they are dynamically bound to the
    DLL. This is achieved by the application calling LoadLibrary at run-time to load
    the DLL and then calling GetProcAddress to retrieve the entry points for the
    functions exported from the DLL.

    Static binding is not supported. From a C or C++ application, static binding is
    achieved by linking import records (either import libraries or entries in the
    IMPORTS section of the application's Module Definition File) to the calling
    application. Using Delphi 2.0, static binding is achieved using a declaration
    such as:

    function Foo(parm: Integer): Integer; stdcall; external 'my.dll' name 'Foo';

    You can use either C++ or Structured Exception Handling in the DLL. For best
    results, exceptions should be caught within the scope of the DLL throwing the
    exception. If the calling application is built with Borland C++, Delphi or
    Microsoft Visual C++, the exception can be caught in the application calling the
    DLL; however, Visual Basic does not seem to have an exception handlng syntax.

    To create an EH-compatible 32-bit DLL, just replace the default startup code,
    c0d32.obj for 32-bit DLL's, with c0d32dyn.obj and re-link the DLL. Using
    command-line tools, the startup code is the first object module specified to
    Tlink32. Using the Integrated Development Environment, select Options |
    Environment | Project View and check Show run-time nodes. In the project window,
    there will now be displayed entries for the startup module and all the libraries
    which are automatically linked in depending on your target. Remove the node for
    the startup code, c0d32.obj, and add c0d32dyn.obj in its place.
    I hope you have a fluent English.
    May be better if I say "I wish you have a fluent English" .
    Si vous voulez créer une DLL qui tient compte de la gestion des exceptions
    vous devez la lier avec une version dynamique de la librairie des DLL.
    Exemple :
    Soit MyDyll la librairie à produire sous Win9x :
    1) bcc32 -c -D_RTLDLL MyDll.c
    2) TLink32 -Tpd -aa -x c0d32dyn MyDll, MyDll.dll, , import32 cw32i
    Cette compilation assure la compatibilité avec Delphi, Visual C++,
    Visual Basic ( sous réserve pour ce dernier ) .


    Je rappelle que ces instructions ne sont valides que pour les créateurs de
    DLL avec Borland C++ 5.02.
    La compatibilité entre appel de DLL entre Borland C++ ( et BCbuilder ) se
    fait par une convention d'appel dite "__stdcall".
    Avec CBuilder les instructions sont légérement différentes.
    Cordialement.

  6. #6
    Membre régulier
    Profil pro
    Inscrit en
    Mars 2002
    Messages
    92
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2002
    Messages : 92
    Points : 84
    Points
    84
    Par défaut
    Ok, merci beaucoup. Quelqu'un a-t-il le même style d'information pour créer des DLLs avec GCC??

Discussions similaires

  1. compiler une dll avec visual studio 2005
    Par DebutantVisualStudio dans le forum Visual C++
    Réponses: 6
    Dernier message: 29/07/2009, 13h33
  2. Compiler le code asxp.vb en une dll avec vbc
    Par mappy dans le forum ASP.NET
    Réponses: 1
    Dernier message: 12/08/2008, 13h26
  3. Compiler une dll avec un makefile ?
    Par tintin72 dans le forum Windows
    Réponses: 1
    Dernier message: 20/02/2008, 23h40
  4. Creer une DLL avec des icônes
    Par Larion dans le forum C++Builder
    Réponses: 5
    Dernier message: 13/03/2005, 17h28
  5. probleme compilation classe avec Borland c++ compiler 5.5
    Par softblue dans le forum Autres éditeurs
    Réponses: 2
    Dernier message: 17/06/2004, 15h16

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo