Bonjour,
J'ai un fichier dll créer avec Visual C++ 10 qui une fichier d'entête avec des fonctions exporter suivant:
- hHandle Initialize();
- int DeInitialize(hHandle H);
- Void OnProcessedFrame(hHandle H, Frames F);
Je traduit ce code en delphi 7, mais j'ai une blocage.
Les fonction initialize et deinitialize n'a pas de probleme sauf le fonction callBack OnProcessedFrame donne des erreurs en renvoie le parametre Frame F.
Ma question est: Comment on traduit correctement le parametre Frame en delphi 7.
J'ai mis en bas le code de Frame qui est dans l'entete C++.
En remarquant que Frame contient des array liste mais il renvoie sous forme de pointeur. Comment renvoie tableau array c++ en delphi 7?
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
119
120
121
122
123
124
125
126
127
128
129
130 /** Alert lengths */ #define ALERT_NAME_LENGTH 256 #define ALERT_TYPE_LENGTH 256 #define ALERT_DESC_LENGTH 1024 #define ATTR_KEY_LENGTH 64 #define ATTR_VALUE_LENGTH 1024 #define CLASS_NAME_LENGTH 64 /** @param Flag that this is the last frame */ #define FLAG_LAST_FRAME "FLAG_LAST_FRAME" /** @struct Timestamp struct */ typedef struct Timestamp { /** @param - Number of seconds since the epoch */ time_t mTime; /** @param - Millisecond portion of the timestamp */ unsigned short mMilliseconds; } Timestamp; /** @struct Alert struct */ typedef struct Alert { /** @param - The starting timestamp of the alert */ Timestamp mStart; /** @param - The elapsed time of the alert in milliseconds */ unsigned int mLength; /** @param The alert name */ char mName[ALERT_NAME_LENGTH]; /** @param - The alert type */ char mType[ALERT_TYPE_LENGTH]; /** @param - The alert's description with the alert */ char mDescription[ALERT_DESC_LENGTH]; /** @param - The priority of the alert */ unsigned short mPriority; /** @param - The Unique Alert ID */ unsigned int mUID; /** @param - The confidence between 1 - 100 */ unsigned short mConf; /** @param - Array of Objects UIDs associated with this event */ unsigned int* mpObjectUIDs; /** @param - Number of Objects associated with this event */ unsigned int mNumObjectUIDs; } Alert; /** @struct Attribute struct */ struct Attribute { /** @param The attribute key */ char mKey[ATTR_KEY_LENGTH]; /** @param The attribute value */ char mValue[ATTR_VALUE_LENGTH]; }; /** @struct Classifcation Confidence struct */ struct ClassConf { /** @param The class name */ char mClassName[ATTR_KEY_LENGTH]; /** @param The confidence between 0.0-1.0 */ float mConfidence; }; /** @struct Object bounding box struct */ typedef struct Object { /** @param - The Object bounding box pixel x (upper-left corner) */ unsigned int mX; /** @param - The Object bounding box pixel y (upper-left corner) */ unsigned int mY; /** @param - The Object bounding box pixel width */ unsigned int mWidth; /** @param - The Object bounding box pixel height */ unsigned int mHeight; /** @param - The Unique Object ID */ unsigned int mUID; /** @param - The detected object class type */ char *mpType; /** @param - The detected object class type's confidence */ float mClassConf; /** @param The object's attributes */ Attribute* mpAttributes; /** @param The number of attributes */ unsigned int mNumAttributes; /** @param The class confidences */ ClassConf* mpClassConfs; /** @param The number of class confidences */ unsigned int mNumClassConfs; } Object; /** @enum Image Types */ typedef enum { ivNoImage = 0, /** No image */ ivNative /** The native image */ } ImageType ; /** @param Frame Drawing Attributes that will be drawn */ #define DRAW_NONE 0x00000000 #define DRAW_BOUNDING_BOXES 0x00000001 /** @struct Frames struct */ typedef struct Frames { /** @param - Pointer to the image data */ const unsigned char* mpData; /** @param - Width of the frame image */ unsigned int mWidth; /** @param - Height of the frame image */ unsigned int mHeight; /** @param The number of bytes per pixel */ unsigned int mBytesPerPixel; /** @param The image data length, mWidth x mHeight x mBytesPerPixel */ unsigned int mDataLength; /** @param The Image Type */ ImageType mImageType; /** @param - Timestamp of the frame */ Timestamp mSysTime; /** @param - Array of current alerts */ Alert* mpAlerts; /** @param - Number of alerts in the array */ unsigned int mNumAlerts; /** @param - Array of current objects */ Object* mpObjects; /** @param - Number of objects in the array */ unsigned int mNumObjects; /** @param The frame's attributes */ Attribute* mpAttributes; /** @param The number of attributes */ unsigned int mNumAttributes; } Frames;
Partager