Bonjour à tous,
J'utilise Delphi7 et je dois interfacer mon application avec une application externe dont on me fournit les DLL et les fichiers include en c++.
Comment puis je faire pour utiliser ces dll ?
Voici par exemple le fichier .h qui m'est fourni
Code c++ : Sélectionner tout - Visualiser dans une fenêtre à part
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118 #ifndef INC_PRNNT_DM_API #define INC_PRNNT_DM_API #ifdef __cplusplus extern "C" { #endif /* PF4 Device manager errors */ #define PRN_OK 0 #define PRN_ERR_NOTEXIST 1 #define PRN_ERR_TIMEOUT 2 #define PRN_ERR_DUPE 3 #define PRN_ERR_INIT 4 #define PRN_ERR_LOCKED 5 //@31 /* PF4 Device Manager Status */ #define PRN_STS_ONLINE 0 #define PRN_STS_OFFLINE 1 #define PRN_STS_INIT 2 #define PRN_STS_POWEROFF 3 #define PRN_RESAEMULSTS_ONLINE 3 #define PRN_RESAEMULSTS_OFFLINE 4 #define PRN_RESAEMULSTS_INIT 14 #define PRN_RESAEMULSTS_POWEROFF 11 /* PF4 Write Device Manager Type */ #define PRT_MODE_AEA 1 /* Automatic Add of AR; */ #define PRT_MODE_GEN 2 #define PRT_MODE_LOGO 3 #define PRT_MODE_CTX 4 #define PRT_MODE_ADMIN 5 /* PF4 Type of devices */ #define PRN_PRT_BPP_ "BPP" #define PRN_PRT_BTP_ "BTP" //---longueur max d'une selection--- #define MAX_SELECTIONNAME_ 30 //--- PF4 return codes for Batch--- #define PRN_BAT_NO_ERROR 0x00 /* OK */ #define PRN_BAT_ERROR_NET 0x01 /* LAN error */ #define PRN_BAT_ERROR_ALREADYOPEN 0x02 /* Already opened */ #define PRN_BAT_ERROR_MAXLENGTH 0x03 /* Data length overflow */ #define PRN_BAT_ERROR_SHELL 0x04 /* Shell Type unknown */ #define PRN_BAT_ERROR_PARAMETER 0x05 /* Wrong parameter */ #define PRN_BAT_ERROR_MEMORY 0x06 /* Memory allocation error */ #define PRN_BAT_ERROR_NOTFOUND 0x07 /* non trouve */ #define PRN_BAT_ERROR_ENDSESSION 0x08 /* End of session */ #define PRN_BAT_ERROR_NOTOPENED 0x09 /* Not opened */ #define PRN_PM_NO_ERROR 0 // OK #define PRN_PM_ERROR_LOCKED 203 // PM Device locked #define PRN_PM_ERROR_NOTFOUND 213 // PM Device not found #define PRN_PM_ERROR_NOTREADY 211 // PM Device not ready /* ************************************************ */ /* PRN_DM_OPEN Opens a peripheral on Device manager */ /* */ /* szType = type of device */ /* "MSG" Message */ /* "RTE" Reader */ /* */ /* Order = Order of peripheral */ /* if 2 periph. with same type => */ /* 0 : first one 1 : second one */ /* */ /* fTrace = Activate trace to the trace server */ /* 0 : No Trace */ /* else : Trace */ /* */ /* RETURN ERC : */ /* PRN_OK : Correct Open */ /* PRN_ERR_NOTEXIST : Peripharal doesn't exist */ /* PRN_ERR_DUPE : Already open */ /* */ /* ************************************************ */ unsigned short PRN_DM_OPEN( char * szType, unsigned short Order, unsigned short fTrace); unsigned short WINAPI PRNVB_DM_OPEN( char * szType, unsigned short Order, unsigned short fTrace); /* ************************************************ */ /* PRN_DM_UNLOCK - lock device */ /* */ /* szCtx = Name of context (3 alphanumeric chars) */ /* */ /* szType = type of device */ /* "MSG" Message */ /* "RTE" Reader */ /* */ /* Order = Order of peripheral */ /* if 2 periph. with same type => */ /* 0 : first one 1 : second one */ /* */ /* RETURN ERC : */ /* PRN_OK : Switch OK */ /* PRN_ERR_NOTEXIST : Peripheral doesn't exist */ /* PRN_ERR_INIT : Peripheral in initialization */ /* PRN_ERR_TIMEOUT : Peripheral not ready */ /* PRN_ERR_LOCKED : Peripharal locked */ /* */ /* ************************************************ */ unsigned short PRN_DM_UNLOCK( char * szType, unsigned short Order); unsigned short PRN_DM_UNLOCK_CTX( char * szCtxIn, char * szType, unsigned short Order); unsigned short WINAPI PRNVB_DM_UNLOCK( char * szType, unsigned short Order); unsigned short WINAPI PRNVB_DM_UNLOCK_CTX( char * szCtxIn, char * szType, unsigned short Order); #ifdef __cplusplus } #endif #endif INC_PRNNT_DM_API
Si quelqu'un peut m'aider à transcrire cela afin que je puisse utiliser la DLL avec mon application en Delphi7 il est le bienvenu.
Merci d'avance pour vos réponses,
Wilco
Partager