Problème de création d'une dll...
Bonjour à tous,
Je voudrais créer une dll. Pour ce faire j'utiliser l'exemple qui est sur ce site.
J'ai utilisé l'expert dll puis j'ai ajouter la ligne 'extern "c" ....'
Voici ci-contre le debut de ma dll :
Code:
1 2 3 4 5 6 7 8 9 10 11
| #include <vcl.h>
#include <windows.h>
#pragma hdrstop
extern "C" __declspec(dllexport) __stdcall SHORT Charge_Horaires(CHAR* fichier_config,HORAIRE * H_C,struct PARAMETRE_SERVICE * Service,CHAR *Region,USHORT Banlieue)
#pragma argsused
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved)
{
return 1;
} |
Lorsque je compile ce code, j'ai une erreur et le curseur ce place sur le mot extern.
Voici le message d'erreur: E2303 Nom de type attendu.
Pourriez-vous m'aider à résoudre ce problème svp.
D'avance merci.
Problème de création d'une dll...
Oui, c'est cet exemple là.
Problème de création d'une dll...
Voici ce que j'aurais du mettre.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include <vcl.h>
#include "stdio.h"
#include <windows.h>
#pragma hdrstop
typedef void * HORAIRE;
extern "C" __declspec(dllexport) __stdcall SHORT Charge_Horaires(CHAR* ,HORAIRE * ,struct PARAMETRE_SERVICE *,CHAR *,USHORT );
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
return 1;
}
SHORT __stdcall Charge_Horaires(CHAR* fichier_config,HORAIRE * H_C,struct PARAMETRE_SERVICE * Service,CHAR *Region,USHORT Banlieue)
{
FILE *fp1;
UCHAR tampon[500], *position;
UCHAR region[200];
USHORT erreur,i;
struct DONNEES_HORAIRES *horaires_en_cours;
USHORT fic1_OK=0;
USHORT fic2_OK=0;
return(1);
} |
Merci à tous.