Bonjour

Je cherche à recompiler avec MIDL un tlb à partir d'un idl généré avec OLE/COM ObjectViewer à partir d'un exe (ouf !).

Malheureusement, MIDL ne veut rien savoir :

1>.\OmniRig.idl(96) : error MIDL2025 : syntax error : expecting a type specification near "RigParamX"
1>.\OmniRig.idl(97) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation
Voici l'IDL :

Code : 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
// Generated .IDL file (by the OLE/COM Object Viewer)
// 
// typelib filename: OmniRig.exe
 
[
  uuid(4FE359C5-A58F-459D-BE95-CA559FB4F270),
  version(1.0),
  helpstring("OmniRig Library")
]
library OmniRig
{
    // TLib :     // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
    importlib("stdole2.tlb");
 
    // Forward declare all types defined in this typelib
    interface IOmniRigX;
    dispinterface IOmniRigXEvents;
    interface IRigX;
    interface IPortBits;
 
    [
      odl,
      uuid(501A2858-3331-467A-837A-989FDEDACC7D),
      version(1.0),
      helpstring("Dispatch interface for OmniRigX Object"),
      dual,
      oleautomation
    ]
    interface IOmniRigX : IDispatch {
        [id(0x00000001), propget]
        HRESULT InterfaceVersion([out, retval] long* Value);
        [id(0x00000002), propget]
        HRESULT SoftwareVersion([out, retval] long* Value);
        [id(0x00000003), propget]
        HRESULT Rig1([out, retval] IRigX** Value);
        [id(0x00000004), propget]
        HRESULT Rig2([out, retval] IRigX** Value);
        [id(0x00000005), propget]
        HRESULT DialogVisible([out, retval] VARIANT_BOOL* Value);
        [id(0x00000005), propput]
        HRESULT DialogVisible([in] VARIANT_BOOL Value);
    };
 
    [
      uuid(2219175F-E561-47E7-AD17-73C4D8891AA1),
      version(1.0),
      helpstring("Events interface for OmniRigX Object")
    ]
    dispinterface IOmniRigXEvents {
        properties:
        methods:
            [id(0x00000001)]
            HRESULT VisibleChange();
            [id(0x00000002)]
            HRESULT RigTypeChange([in] long RigNumber);
            [id(0x00000003)]
            HRESULT StatusChange([in] long RigNumber);
            [id(0x00000004)]
            HRESULT ParamsChange(
                            [in] long RigNumber, 
                            [in] long Params);
            [id(0x00000005)]
            HRESULT CustomReply(
                            [in] long RigNumber, 
                            [in] VARIANT Command, 
                            [in] VARIANT Reply);
    };
 
    [
      uuid(0839E8C6-ED30-4950-8087-966F970F0CAE),
      version(1.0),
      helpstring("OmniRigX Object")
    ]
    coclass OmniRigX {
        [default] interface IOmniRigX;
        [default, source] dispinterface IOmniRigXEvents;
    };
 
    [
      odl,
      uuid(D30A7E51-5862-45B7-BFFA-6415917DA0CF),
      version(1.0),
      helpstring("Dispatch interface for Rig Object"),
      dual,
      oleautomation
    ]
    interface IRigX : IDispatch {
        [id(0x00000001), propget]
        HRESULT RigType([out, retval] BSTR* Value);
        [id(0x00000002), propget]
        HRESULT ReadableParams([out, retval] long* Value);
        [id(0x00000003), propget]
        HRESULT WriteableParams([out, retval] long* Value);
        [id(0x00000004)]
        HRESULT IsParamReadable(
                        [in] RigParamX Param, 
                        [out, retval] VARIANT_BOOL* Value);
        [id(0x00000005)]
        HRESULT IsParamWriteable(
                        [in] RigParamX Param, 
                        [out, retval] VARIANT_BOOL* Value);
        [id(0x00000006), propget]
        HRESULT Status([out, retval] RigStatusX* Value);
        [id(0x00000007), propget]
        HRESULT StatusStr([out, retval] BSTR* Value);
        [id(0x00000008), propget]
        HRESULT Freq([out, retval] long* Value);
        [id(0x00000008), propput]
        HRESULT Freq([in] long Value);
        [id(0x00000009), propget]
        HRESULT FreqA([out, retval] long* Value);
        [id(0x00000009), propput]
        HRESULT FreqA([in] long Value);
        [id(0x0000000a), propget]
        HRESULT FreqB([out, retval] long* Value);
        [id(0x0000000a), propput]
        HRESULT FreqB([in] long Value);
        [id(0x0000000b), propget]
        HRESULT RitOffset([out, retval] long* Value);
        [id(0x0000000b), propput]
        HRESULT RitOffset([in] long Value);
        [id(0x0000000c), propget]
        HRESULT Pitch([out, retval] long* Value);
        [id(0x0000000c), propput]
        HRESULT Pitch([in] long Value);
        [id(0x0000000d), propget]
        HRESULT Vfo([out, retval] RigParamX* Value);
        [id(0x0000000d), propput]
        HRESULT Vfo([in] RigParamX Value);
        [id(0x0000000e), propget]
        HRESULT Split([out, retval] RigParamX* Value);
        [id(0x0000000e), propput]
        HRESULT Split([in] RigParamX Value);
        [id(0x0000000f), propget]
        HRESULT Rit([out, retval] RigParamX* Value);
        [id(0x0000000f), propput]
        HRESULT Rit([in] RigParamX Value);
        [id(0x00000010), propget]
        HRESULT Xit([out, retval] RigParamX* Value);
        [id(0x00000010), propput]
        HRESULT Xit([in] RigParamX Value);
        [id(0x00000011), propget]
        HRESULT Tx([out, retval] RigParamX* Value);
        [id(0x00000011), propput]
        HRESULT Tx([in] RigParamX Value);
        [id(0x00000012), propget]
        HRESULT Mode([out, retval] RigParamX* Value);
        [id(0x00000012), propput]
        HRESULT Mode([in] RigParamX Value);
        [id(0x00000013)]
        HRESULT ClearRit();
        [id(0x00000014)]
        HRESULT SetSimplexMode([in] long Freq);
        [id(0x00000015)]
        HRESULT SetSplitMode(
                        [in] long RxFreq, 
                        [in] long TxFreq);
        [id(0x00000016)]
        HRESULT FrequencyOfTone(
                        [in] long Tone, 
                        [out, retval] long* Value);
        [id(0x00000017)]
        HRESULT SendCustomCommand(
                        [in] VARIANT Command, 
                        [in] long ReplyLength, 
                        [in] VARIANT ReplyEnd);
        [id(0x00000018)]
        HRESULT GetRxFrequency([out, retval] long* Value);
        [id(0x00000019)]
        HRESULT GetTxFrequency([out, retval] long* Value);
        [id(0x0000001a), propget]
        HRESULT PortBits([out, retval] IPortBits** Value);
    };
 
    [
      uuid(78AECFA2-3F52-4E39-98D3-1646C00A6234),
      version(1.0),
      helpstring("Rig Object")
    ]
    coclass RigX {
        [default] interface IRigX;
    };
 
    typedef [uuid(80E6D479-0553-44E9-AA50-1878A12719FB), version(1.0)]
    enum {
        PM_UNKNOWN = 1,
        PM_FREQ = 2,
        PM_FREQA = 4,
        PM_FREQB = 8,
        PM_PITCH = 16,
        PM_RITOFFSET = 32,
        PM_RIT0 = 64,
        PM_VFOAA = 128,
        PM_VFOAB = 256,
        PM_VFOBA = 512,
        PM_VFOBB = 1024,
        PM_VFOA = 2048,
        PM_VFOB = 4096,
        PM_VFOEQUAL = 8192,
        PM_VFOSWAP = 16384,
        PM_SPLITON = 32768,
        PM_SPLITOFF = 0x00010000,
        PM_RITON = 0x00020000,
        PM_RITOFF = 0x00040000,
        PM_XITON = 0x00080000,
        PM_XITOFF = 0x00100000,
        PM_RX = 0x00200000,
        PM_TX = 0x00400000,
        PM_CW_U = 0x00800000,
        PM_CW_L = 0x01000000,
        PM_SSB_U = 0x02000000,
        PM_SSB_L = 0x04000000,
        PM_DIG_U = 0x08000000,
        PM_DIG_L = 0x10000000,
        PM_AM = 0x20000000,
        PM_FM = 0x40000000
    } RigParamX;
 
    typedef [uuid(47EE3D83-5CC0-4C3E-94FB-28FF8DC79C48), version(1.0)]
    enum {
        ST_NOTCONFIGURED = 0,
        ST_DISABLED = 1,
        ST_PORTBUSY = 2,
        ST_NOTRESPONDING = 3,
        ST_ONLINE = 4
    } RigStatusX;
 
    [
      odl,
      uuid(3DEE2CC8-1EA3-46E7-B8B4-3E7321F2446A),
      version(1.0),
      dual,
      oleautomation
    ]
    interface IPortBits : IDispatch {
        [id(0x00000001)]
        HRESULT Lock([out, retval] VARIANT_BOOL* Ok);
        [id(0x00000002), propget]
        HRESULT Rts([out, retval] VARIANT_BOOL* Value);
        [id(0x00000002), propput]
        HRESULT Rts([in] VARIANT_BOOL Value);
        [id(0x00000003), propget]
        HRESULT Dtr([out, retval] VARIANT_BOOL* Value);
        [id(0x00000003), propput]
        HRESULT Dtr([in] VARIANT_BOOL Value);
        [id(0x00000004), propget]
        HRESULT Cts([out, retval] VARIANT_BOOL* Value);
        [id(0x00000005), propget]
        HRESULT Dsr([out, retval] VARIANT_BOOL* Value);
        [id(0x00000006)]
        HRESULT Unlock();
    };
 
    [
      uuid(B786DE29-3B3D-4C66-B7C4-547F9A77A21D),
      version(1.0),
      helpstring("PortBits Object")
    ]
    coclass PortBits {
        [default] interface IPortBits;
    };
};
J'avoue patauger un peu...

Merci !

Résolu : En fait, l'idl en question n'est pas utilisable en l'état - Il faut le modifier pour déplacer les déclaration de type (les typedefs enum) avant les déclarations d'interfaces...