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

Windows Discussion :

Utilisation d'un .tlb en C


Sujet :

Windows

  1. #1
    Membre du Club
    Inscrit en
    Juillet 2008
    Messages
    117
    Détails du profil
    Informations forums :
    Inscription : Juillet 2008
    Messages : 117
    Points : 58
    Points
    58
    Par défaut Utilisation d'un .tlb en C
    Bonjour, même si cela fait plus d'un an que je fais du C, je poste sur cette partie du forum pour avoir des renseignement concernant les .tlb.

    Voila mon maître de stage m'a demander d'utiliser une type library dans un programme en C.
    Après quelques recherches, il s'avère que ce type de fichier ressemble grosso modo une dll (à l'inverse d'une dll, il n'y a pas d'utilisation de header nécessaire).
    Mais bon je ne suis pas sur de ce que j'avance et j'aurais aimer avoir plus d'information sur ce sujet.

    Et deuxième question est-il possible d'utiliser une type library dans un .c ?

    Merci d'avance.

  2. #2
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 379
    Points : 41 573
    Points
    41 573
    Par défaut
    Bonjour,
    Un .tlb est une bibliothèque de types (type library) qui définit des interfaces COM (avec leurs UUIDs) et parfois aussi des UUIDs de classes COM. En clair, c'est un fichier IDL Microsoft compilé.

    Utiliser un .tlb directement n'est, à ma connaissance, pas possible en C. C'est possible en C++ sous Visual Studio (directive #import), et dans des langages de plus haut niveau. Et sous MinGW, n'en parlons pas.

    Le problème pour le C, c'est que normalement la compilation d'un fichier .idl ne donne pas seulement un .tlb, mais aussi un fichier d'en-tête .h, détaillant les interfaces aussi bien pour le C que pour le C++. Malheureusement, trop souvent les éditeurs ne distribuent que le .tlb. Mais si tu possèdes les outils de Visual, tout n'est pas perdu, car il est possible de reconstituer le .h!

    Pour cela, deux étapes:
    • Régénérer le fichier .idl à partir du .tlb. C'est possible avec l'outil Microsoft OLE/COM Object Viewer (OLEVIEW.EXE), fourni avec Visual.
      Menu "File" -> "View TypeLib...", puis dans la nouvelle fenêtre, "File" -> "Save As..." -> ".idl"
    • Recompiler le fichier .idl. Le plus simple est d'ouvrir un invite de commandes Visual Studio et d'appeler MIDL.EXE sur le fichier. Sa compilation va générer un nouveau .tlb, des fichiers source C (un pour les UUIDs, et un dont tu ne devrais pas avoir besoin, pour les proxys COM) et surtout un nouveau fichier .h utilisable en C ou C++.

  3. #3
    Membre du Club
    Inscrit en
    Juillet 2008
    Messages
    117
    Détails du profil
    Informations forums :
    Inscription : Juillet 2008
    Messages : 117
    Points : 58
    Points
    58
    Par défaut
    Bonjour, tout d'abord merci Médinoc pour ta réponse clair et précise.
    Alors, nous avons réussi à récupérer le .idl grâce à l'outil OLEVIEW.EXE.
    Mais lors de la recompilation nous n'obtenons que le .tlb, pas de .h ni de .c

    Voici la ligne de commande que nous utilisons :
    /app_config C:\Temp\TLB\OmniPage15.IDL /out C:\Temp\TLB
    A voire si les .c et le .h ne sont pas stocker autre part mais impossible de les trouver.

    Merci

  4. #4
    Membre du Club
    Inscrit en
    Juillet 2008
    Messages
    117
    Détails du profil
    Informations forums :
    Inscription : Juillet 2008
    Messages : 117
    Points : 58
    Points
    58
    Par défaut
    Arf message en double, je ne peut pas supprimer le dernier post.

  5. #5
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 379
    Points : 41 573
    Points
    41 573
    Par défaut
    Je ne connais pas app_config, généralement j'utilise directement midl.exe fichier.idl, sans autre paramètre (sauf /out pour spécifier un répertoire de sortie).

  6. #6
    Expert éminent
    Avatar de Melem
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Janvier 2006
    Messages
    3 656
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Essonne (Île de France)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Janvier 2006
    Messages : 3 656
    Points : 8 389
    Points
    8 389
    Par défaut
    Une autre astuce c'est de demander à Visual Studio, dans un projet MFC, de générer une classe C++ qui encapsule l'interface qu'on veut utiliser. Ca se fait en quelques clics : Insert Class from a Type Library (la manière de s'y prendre dépend de la version de Visual utilisée, avec Class Wizzard dans VC6 et Project > Add dans 2005). Ensuite t'as qu'à aller voir dans le code source pour voir le numéro de telle propriété ou telle méthode et créer des fonctions C qui y accèdent (grâce à la méthode Invoke de IDispatch) ou mieux et plus simple fournir des interfaces C pour le constructeur, déstructeur et les méthodes de la classe qu'on veut utiliser et appeler ces fonctions depuis du code C.

  7. #7
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 379
    Points : 41 573
    Points
    41 573
    Par défaut
    Mais ça ne marche que pour les interfaces duales et les dispinterfaces, et c'est moins efficace qu'appeler l'interface directement.

  8. #8
    Expert éminent
    Avatar de Melem
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Janvier 2006
    Messages
    3 656
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Essonne (Île de France)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Janvier 2006
    Messages : 3 656
    Points : 8 389
    Points
    8 389
    Par défaut
    Mais dans la pratique (bien représentée par ActiveX et Automation) c'est rare pour ne pas dire très rare qu'on n'ait pas droit à des disp-interfaces mais bon, je donnais ça juste pour info d'ailleurs puisque LA solution elle-même tu l'as déjà donnée ...

  9. #9
    Membre du Club
    Inscrit en
    Juillet 2008
    Messages
    117
    Détails du profil
    Informations forums :
    Inscription : Juillet 2008
    Messages : 117
    Points : 58
    Points
    58
    Par défaut
    Citation Envoyé par Médinoc Voir le message
    Je ne connais pas app_config, généralement j'utilise directement midl.exe fichier.idl, sans autre paramètre (sauf /out pour spécifier un répertoire de sortie).
    J'ai aussi essayer avec cette méthode et pas de fichiers sources, juste le .tlb apparait C'est vraiment bizarre ..

    ps: je suis sous visual studio 2005

  10. #10
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 379
    Points : 41 573
    Points
    41 573
    Par défaut
    Bizarre...
    Puis-je voir le fichier IDL ?

  11. #11
    Membre du Club
    Inscrit en
    Juillet 2008
    Messages
    117
    Détails du profil
    Informations forums :
    Inscription : Juillet 2008
    Messages : 117
    Points : 58
    Points
    58
    Par défaut
    Voila :
    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
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    // Generated .IDL file (by the OLE/COM Object Viewer)
    // 
    // typelib filename: <could not determine filename>
    
    [
      uuid(22996F69-B06F-4F22-A9D9-CD2D48C55362),
      version(1.0),
      custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 100663657),
      custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1181558890),
      custom(DE77BA65-517C-11D1-A2DA-0000F8773CE9, "Created by MIDL version 6.00.0361 at Mon Jun 11 12:48:10 2007")
    ]
    library OmniPage15
    {
        // TLib :     // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
        importlib("stdole2.tlb");
    
        // Forward declare all types defined in this typelib
        interface IApplication;
        interface IProcess;
        interface IProcessWF;
        dispinterface _DOPProgress;
        interface IExportTextFormats;
        interface IExportTextFormat;
        interface IOPLanguages;
        interface IOPLanguage;
        interface IImageFormats;
        interface IImageFormat;
        interface IWorkflows;
        interface IWorkflow;
        interface IOPScanner;
        interface IOPProgress;
    
        typedef [public]
        __MIDL___MIDL_itf_OmniPage_0000_0001 OptionDlgPage;
    
        typedef enum {
            OP_ACCURACY_PAGE = 1,
            OP_EXPORT_PAGE = 2,
            OP_LANGUAGE_PAGE = 4,
            OP_CONFIGURE_PAGE = 8,
            OP_SCANNER_PAGE = 16,
            OP_DIRECT_PAGE = 32,
            OP_DIRECT_MINI_PAGE = 64,
            OP_CHECK_REC_PAGE = 128,
            OP_PAPERPORT_PAGE = 256,
            OP_OPUSACCURACY_PAGE = 512,
            OP_EXPORTCR_PAGE = 1024,
            OP_KIMCHEE_LANG_PAGE = 2048,
            OP_KIMCHEE_ACCU_PAGE = 4096,
            OP_TABLE_PAGE = 8192
        } __MIDL___MIDL_itf_OmniPage_0000_0001;
    
        typedef [public]
        tag_eZoning eZoning;
    
        typedef enum {
            OP_ZONE_DEFAULT = 0xffffffff,
            OP_ZONE_MANUAL = 0,
            OP_ZONE_AUTO = 1
        } tag_eZoning;
    
        typedef [public]
        tag_eProofReadFlag eProofReadFlag;
    
        typedef enum {
            OP_CHECKREC_MODAL = 0xfffffffe,
            OP_CHECKREC_DEFAULT = 0xffffffff,
            OP_CHECKREC_OFF = 0,
            OP_CHECKREC_CURRPAGE = 1,
            OP_CHECKREC_ALLPAGES = 2
        } tag_eProofReadFlag;
    
        typedef [public]
        __MIDL___MIDL_itf_OmniPage_0000_0002 OPOLE_ERROR;
    
        typedef enum {
            OPOLE_SUCCESS = 0,
            OPOLE_INIT = 1,
            OPOLE_INTERNAL = 2,
            OPOLE_UNSAVEDFILE = 3,
            OPOLE_NOFILENAME = 4,
            OPOLE_DOCOPENFAILED = 5,
            OPOLE_EMPTYDOC = 6,
            OPOLE_DOCSAVEFAILED = 7,
            OPOLE_IMGSOURCE = 8,
            OPOLE_CREATENEWPAGE = 9,
            OPOLE_INVALIDPARAM = 10,
            OPOLE_IMAGESIZEERROR = 11,
            OPOLE_PROCESSNOTCOMPLETE = 12,
            OPOLE_ACTIONCANCELED = 13,
            OPOLE_TTSNOTAVAIL = 14,
            OPOLE_TTSDISABLED = 15,
            OPOLE_OUTOFPAGERANGE = 16,
            OPOLE_NOTEXT = 17,
            OPOLE_IMAGECONVERSION = 18,
            OPOLE_IMAGESAVECOLOR = 19,
            OPOLE_NOTUILANGUAGE = 20,
            OPOLE_BLANKPAGES = 21
        } __MIDL___MIDL_itf_OmniPage_0000_0002;
    
        typedef [public]
        tagIMGSRC IMGSRC;
    
        typedef enum {
            IMGSRC_DISKFILE = 0,
            IMGSRC_SCANNER = 1
        } tagIMGSRC;
    
        typedef [public]
        tagINSERTMODE INSERTMODE;
    
        typedef enum {
            INSERT_LAST = 0,
            INSERT_AFTERCURRENT = 1,
            INSERT_BEFORECURRENT = 2,
            INSERT_FIRST = 3
        } tagINSERTMODE;
    
        typedef [public]
        tagRECMODE RECMODE;
    
        typedef enum {
            RM_PROCESSALL = 0,
            RM_PROCESSNOTREC = 1
        } tagRECMODE;
    
        typedef [public]
        tagLYTDESCR LYTDESCR;
    
        typedef enum {
            eLytFmtAuto = 0,
            eLytFmtSingleColNoTbl = 1,
            eLytFmtMultiColNoTbl = 2,
            eLytFmtSingleColTbl = 3,
            eLytFmtSpreadsheet = 4,
            eLytFmtForm = 5,
            eLytFmtCustom = 6,
            eLytFmtTemplate = 7
        } tagLYTDESCR;
    
        typedef [public]
        tagRETAINCOLOROPT RETAINCOLOROPT;
    
        typedef enum {
            eRetainCol_Off = 0,
            eRetainCol_InvertedText = 1,
            eRetainCol_On = 2
        } tagRETAINCOLOROPT;
    
        typedef [public]
        tagEXPTRG EXPTRG;
    
        typedef enum {
            eExpUndefined = 0xffffffff,
            eExpToDisk = 0,
            eExpToMail = 1,
            eExpToClipboard = 2
        } tagEXPTRG;
    
        typedef [public]
        tagFMTLVL FMTLVL;
    
        typedef enum {
            eFmtLvlRemove = 0,
            eFmtLvlIgnoreAll = 1,
            eFmtLvlRFP = 2,
            eFmtLvlTruePage = 3,
            eFmtLvlRFC = 4,
            eFmtLvlSpreadSheet = 5
        } tagFMTLVL;
    
        typedef [public]
        tagEXPFILEOPT EXPFILEOPT;
    
        typedef enum {
            eExpOneFile = 0,
            eExpSeparatePerPage = 1,
            eExpSeparatePerBlank = 2
        } tagEXPFILEOPT;
    
        typedef [public]
        tagIMGFILEOPT IMGFILEOPT;
    
        typedef enum {
            eImgExpMultiPage = 0,
            eImgExpSinglePage = 1
        } tagIMGFILEOPT;
    
        typedef [public]
        tagIMAGEFORMATTYPE IMAGEFORMATTYPE;
    
        typedef enum {
            eEnumInputFormats = 0,
            eEnumOutputFormats = 1,
            eEnumAllFormats = 2
        } tagIMAGEFORMATTYPE;
    
        typedef [public]
        tagSCANRESOLUTION SCANRESOLUTION;
    
        typedef enum {
            eScnRes200dpi = 1,
            eScnRes300dpi = 2
        } tagSCANRESOLUTION;
    
        typedef [public]
        tagSCANMODE SCANMODE;
    
        typedef enum {
            eScnMode_Undef = 0xffffffff,
            eScnMode_BW = 0,
            eScnMode_Gray = 1,
            eScnMode_Color = 2
        } tagSCANMODE;
    
        typedef [public]
        tagPAPERSIZE PAPERSIZE;
    
        typedef enum {
            ps_UnassignedSize = 0,
            ps_Letter = 1,
            ps_A3 = 2,
            ps_A4 = 4,
            ps_A5 = 8,
            ps_B4 = 16,
            ps_B5 = 32,
            ps_Legal = 64,
            ps_DLetter = 128
        } tagPAPERSIZE;
    
        typedef [public]
        tagORIENTATION ORIENTATION;
    
        typedef enum {
            eOrient_Portrait = 0,
            eOrient_Landscape = 1
        } tagORIENTATION;
    
        typedef [public]
        tagPROCESSTYPES PROGRESSTYPES;
    
        typedef enum {
            prog_LoadImages = 0,
            prog_ScanImages = 1,
            prog_Recognize = 2,
            prog_SaveDocumentAs = 3,
            prog_SaveDocument = 4,
            prog_OpenDocument = 5,
            prog_SaveImages = 6,
            prog_ConvertImage = 7
        } tagPROCESSTYPES;
    
        [
          odl,
          uuid(3FE73DD6-D3CB-4224-8D70-2E8F0D0F7BBA),
          dual,
          oleautomation
        ]
        interface IApplication : IDispatch {
            [id(0x00000001), propget, helpstring("Name of application")]
            HRESULT AppName([out, retval] BSTR* Name);
            [id(0x00000002), propget, helpstring("Version information about OmniPage")]
            HRESULT Version([out, retval] long* AppVersion);
            [id(0x00000003), propget, helpstring("Application busy flag")]
            HRESULT AppBusy([out, retval] VARIANT_BOOL* Busy);
            [id(0x00000004), propget, helpstring("Application initialized")]
            HRESULT AppInitialized([out, retval] VARIANT_BOOL* AppInit);
            [id(0x00000005), helpstring("Initialize OmniPage for automation")]
            HRESULT Login(
                            [in] BSTR Key, 
                            [out, retval] IDispatch** IOCRProcess);
            [id(0x00000006), propget, helpstring("Silent mode")]
            HRESULT SilentMode([out, retval] VARIANT_BOOL* pValue);
            [id(0x00000006), propput, helpstring("Silent mode")]
            HRESULT SilentMode([in] VARIANT_BOOL pValue);
            [id(0x00000007), propput, helpstring("Set the parent window of any UI elements")]
            HRESULT ParentWindow(long rhs);
        };
    
        [
          uuid(899BB9A8-C92B-4373-98C4-10E8AB297DCA)
        ]
        coclass Application {
            [default] interface IApplication;
        };
    
        [
          odl,
          uuid(DDD0CB9C-F207-4CC5-8207-30FE756F4511),
          dual,
          oleautomation
        ]
        interface IProcess : IDispatch {
            [id(0x00000001), propget, helpstring("property AutoSave")]
            HRESULT AutoSave([out, retval] VARIANT_BOOL* AutoSave);
            [id(0x00000001), propput, helpstring("property AutoSave")]
            HRESULT AutoSave([in] VARIANT_BOOL AutoSave);
            [id(0x00000002), helpstring("Create new OmniPage document")]
            HRESULT CreateDocument([out, retval] long* Error);
            [id(0x00000003), helpstring("Open an existing document or display Open dialog box of OmniPage")]
            HRESULT OpenDocument(
                            [in] BSTR Filename, 
                            [out, retval] long* Error);
            [id(0x00000004), helpstring("Save the currently opened document")]
            HRESULT SaveDocument(
                            [in] BSTR Filename, 
                            [out, retval] long* Error);
            [id(0x00000005), helpstring("Print images of current document")]
            HRESULT PrintImages(
                            [in] short FirstPage, 
                            [in] short LastPage, 
                            [out, retval] long* Error);
            [id(0x00000006), helpstring("Print text of current document")]
            HRESULT PrintText(
                            [in] short FirstPage, 
                            [in] short LastPage, 
                            [out, retval] long* Error);
            [id(0x00000007), propget, helpstring("Is TTS available")]
            HRESULT TTSStatus([out, retval] VARIANT_BOOL* Avail);
            [id(0x00000008), propget, helpstring("TTS enable state")]
            HRESULT TTSEnabled([out, retval] VARIANT_BOOL* Enabled);
            [id(0x00000008), propput, helpstring("TTS enable state")]
            HRESULT TTSEnabled([in] VARIANT_BOOL Enabled);
            [id(0x00000009), helpstring("ReadDocumentOut method")]
            HRESULT ReadDocument(
                            [in] short Page, 
                            [out, retval] long* Error);
            [id(0x0000000a), helpstring("Stop Reading method")]
            HRESULT StopReading([out, retval] long* Error);
            [id(0x0000000b), propget, helpstring("Is the current document modified")]
            HRESULT DocModifiedFlag([out, retval] VARIANT_BOOL* Modified);
            [id(0x0000000c), propget, helpstring("Get number of pages in the current document")]
            HRESULT PageCount([out, retval] long* Modified);
            [id(0x00000014), helpstring("Add image filename to the list of images to load")]
            HRESULT ImportImage(BSTR Filename);
            [id(0x00000015), helpstring("Load specified image or images added to load list")]
            HRESULT LoadImages(
                            [in] BSTR Filename, 
                            [out, retval] long* Error);
            [id(0x00000016), propget, helpstring("Get source of images")]
            HRESULT ImageSource([out, retval] IMGSRC* IMGSRC);
            [id(0x00000016), propput, helpstring("Get source of images")]
            HRESULT ImageSource([in] IMGSRC IMGSRC);
            [id(0x00000017), propget, helpstring("Get InsertPage property")]
            HRESULT INSERTMODE([out, retval] INSERTMODE* insertpage);
            [id(0x00000017), propput, helpstring("Get InsertPage property")]
            HRESULT INSERTMODE([in] INSERTMODE insertpage);
            [id(0x00000018)]
            HRESULT StartAddImage(
                            [in] short w, 
                            [in] short h, 
                            [in] short bpp, 
                            [in] short xres, 
                            [in] short yres, 
                            [in] short align, 
                            [out, retval] long* pError);
            [id(0x00000019)]
            HRESULT AddImageData(
                            [in] short lineStart, 
                            [in] short lineLen, 
                            [in] VARIANT vSafeArray, 
                            [in] short dataSize, 
                            [out, retval] long* pError);
            [id(0x0000001a)]
            HRESULT StopAddImage([out, retval] long* Error);
            [id(0x0000001e), propget, helpstring("Get Layout format")]
            HRESULT LayoutDescription([out, retval] LYTDESCR* Layout);
            [id(0x0000001e), propput, helpstring("Get Layout format")]
            HRESULT LayoutDescription([in] LYTDESCR Layout);
            [id(0x0000001f), propget, helpstring("Get template filename")]
            HRESULT TemplateFilename([out, retval] BSTR* Filename);
            [id(0x0000001f), propput, helpstring("Get template filename")]
            HRESULT TemplateFilename([in] BSTR Filename);
            [id(0x00000020), propget, helpstring("Get AutoZone property")]
            HRESULT AutoZoneState([out, retval] VARIANT_BOOL* Value);
            [id(0x00000020), propput, helpstring("Get AutoZone property")]
            HRESULT AutoZoneState([in] VARIANT_BOOL Value);
            [id(0x00000021), helpstring("Make interface visible to allow manual zoning")]
            HRESULT ZoneImage(
                            [in] long Flag, 
                            [out, retval] long* Error);
            [id(0x00000028), propget, helpstring("Get rejection symbol")]
            HRESULT RejectSymbol([out, retval] short* Reject);
            [id(0x00000028), propput, helpstring("Get rejection symbol")]
            HRESULT RejectSymbol([in] short Reject);
            [id(0x00000029), propget, helpstring("Get user dictionary")]
            HRESULT UserDictionary([out, retval] BSTR* UserDict);
            [id(0x00000029), propput, helpstring("Get user dictionary")]
            HRESULT UserDictionary([in] BSTR UserDict);
            [id(0x0000002a), propget, helpstring("Get training file")]
            HRESULT TrainingFile([out, retval] BSTR* Train);
            [id(0x0000002a), propput, helpstring("Get training file")]
            HRESULT TrainingFile([in] BSTR Train);
            [id(0x0000002b), helpstring("Recognize specified pages of the current document")]
            HRESULT Recognize(
                            [in] RECMODE Flag, 
                            [out, retval] long* Error);
            [id(0x0000002c), helpstring("Convert image to text file")]
            HRESULT ProcessImage(
                            [in] BSTR ImageFilename, 
                            [in] BSTR TextFilename, 
                            [out, retval] long* Error);
            [id(0x0000002d), propget, helpstring("Languages collection")]
            HRESULT Languages([out, retval] IDispatch** Languages);
            [id(0x00000032), propget, helpstring("Get automatic orientation setting")]
            HRESULT AutoRotation([out, retval] VARIANT_BOOL* autoorient);
            [id(0x00000032), propput, helpstring("Get automatic orientation setting")]
            HRESULT AutoRotation([in] VARIANT_BOOL autoorient);
            [id(0x00000033), propget, helpstring("Get Retain Colors setting")]
            HRESULT RetainColor([out, retval] RETAINCOLOROPT* pValue);
            [id(0x00000033), propput, helpstring("Get Retain Colors setting")]
            HRESULT RetainColor([in] RETAINCOLOROPT pValue);
            [id(0x00000034), propget, helpstring("Get automatic Proofread option")]
            HRESULT AutoProof([out, retval] VARIANT_BOOL* pValue);
            [id(0x00000034), propput, helpstring("Get automatic Proofread option")]
            HRESULT AutoProof([in] VARIANT_BOOL pValue);
            [id(0x00000035), helpstring("Proof-read OCR result")]
            HRESULT Proof(
                            [in] eProofReadFlag Flag, 
                            [out, retval] long* Error);
            [id(0x0000003c), propget, helpstring("Export Target: file, mail, clipboard")]
            HRESULT ExportTarget([out, retval] EXPTRG* pValue);
            [id(0x0000003c), propput, helpstring("Export Target: file, mail, clipboard")]
            HRESULT ExportTarget([in] EXPTRG pValue);
            [id(0x0000003d), propget, helpstring("Export file format")]
            HRESULT ExportTextFormat([out, retval] VARIANT* ConvID);
            [id(0x0000003d), propput, helpstring("Export file format")]
            HRESULT ExportTextFormat([in] VARIANT ConvID);
            [id(0x0000003e), propget, helpstring("Export formatting level")]
            HRESULT ExportFormattingLevel([out, retval] FMTLVL* pValue);
            [id(0x0000003e), propput, helpstring("Export formatting level")]
            HRESULT ExportFormattingLevel([in] FMTLVL pValue);
            [id(0x0000003f), propget, helpstring("Page separation on export")]
            HRESULT TextSeparation([out, retval] EXPFILEOPT* pValue);
            [id(0x0000003f), propput, helpstring("Page separation on export")]
            HRESULT TextSeparation([in] EXPFILEOPT pValue);
            [id(0x00000040), propget, helpstring("Launch associated application on export")]
            HRESULT LaunchOnExport([out, retval] VARIANT_BOOL* pValue);
            [id(0x00000040), propput, helpstring("Launch associated application on export")]
            HRESULT LaunchOnExport([in] VARIANT_BOOL pValue);
            [id(0x00000041), propget, helpstring("Collection of output text formats")]
            HRESULT ExportTextFormats([out, retval] IDispatch** pValue);
            [id(0x00000042), helpstring("Save the currently opened document in the specified format")]
            HRESULT ExportDocument(
                            [in] BSTR Filename, 
                            [out, retval] long* Error);
            [id(0x00000046), helpstring("Save images in the current document regarding to the settings")]
            HRESULT ExportImageFiles(
                            [in] BSTR Filename, 
                            [out, retval] long* Error);
            [id(0x00000047), propget, helpstring("Get image file format")]
            HRESULT ExportImageFormat([out, retval] VARIANT* FormatID);
            [id(0x00000047), propput, helpstring("Get image file format")]
            HRESULT ExportImageFormat([in] VARIANT FormatID);
            [id(0x00000048), propget, helpstring("Get image separation option")]
            HRESULT ImageSeparation([out, retval] IMGFILEOPT* pValue);
            [id(0x00000048), propput, helpstring("Get image separation option")]
            HRESULT ImageSeparation([in] IMGFILEOPT pValue);
            [id(0x00000049), propget, helpstring("Collection of imagefile formats")]
            HRESULT ImageFormats(
                            [in] IMAGEFORMATTYPE type, 
                            [out, retval] IDispatch** pValue);
            [id(0x00000050), helpstring("Load settings from the specified INI file")]
            HRESULT LoadSettings(
                            [in] BSTR Filename, 
                            [out, retval] long* pError);
            [id(0x00000051), helpstring("Save settings into the specified INI file")]
            HRESULT SaveSettings(
                            [in] BSTR Filename, 
                            [out, retval] long* pError);
            [id(0x00000052), helpstring("Invoke Settings window")]
            HRESULT OptionsDialog([in] long Flag);
            [id(0x0000005a), propget, helpstring("Get scanner support interface")]
            HRESULT Scanner([out, retval] IDispatch** Scanner);
            [id(0x0000005b), propget, helpstring("Get error description string")]
            HRESULT LastError([out, retval] BSTR* ErrorString);
        };

  12. #12
    Membre du Club
    Inscrit en
    Juillet 2008
    Messages
    117
    Détails du profil
    Informations forums :
    Inscription : Juillet 2008
    Messages : 117
    Points : 58
    Points
    58
    Par défaut
    La 2ème partie, c'était un peu long :

    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
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
        [
          odl,
          uuid(910C5362-2A7B-413E-874E-0B282DECFCEB),
          dual,
          oleautomation
        ]
        interface IProcessWF : IProcess {
            [id(0x0000005c), propget, helpstring("Collection of workflows")]
            HRESULT Workflows([out, retval] IDispatch** pValue);
            [id(0x0000005d), helpstring("Execute a workflow")]
            HRESULT ExecuteWorkflow(
                            [in] BSTR WorkflowFileName, 
                            [out, retval] long* Error);
        };
    
        [
          uuid(1470DB17-A578-4B77-AE60-A1D276AE9E9C)
        ]
        dispinterface _DOPProgress {
            properties:
            methods:
                [id(0x00000001), helpstring("Start progress monitor")]
                void Start(long proctype);
                [id(0x00000002), helpstring("Progress monitor")]
                long Progress(
                                long proctype, 
                                long percent);
                [id(0x00000003), helpstring("Page number currently is under processing")]
                void SetPageNumber(long pageno);
                [id(0x00000004), helpstring("Progress monitor")]
                void Stop(long proctype);
        };
    
        [
          uuid(4ACB6909-2B21-4155-B1C5-AAA9F846F8E1),
          noncreatable
        ]
        coclass ProcObj {
            [default] interface IProcess;
            interface IProcessWF;
            [default, source] dispinterface _DOPProgress;
        };
    
        [
          odl,
          uuid(7B6598CD-D0F4-4FEF-B82A-94517D03706C),
          dual,
          oleautomation
        ]
        interface IExportTextFormats : IDispatch {
            [id(0x00000001), propget, helpstring("Get number of available export text formats")]
            HRESULT Count([out, retval] long* pValue);
            [id(0x00000002), propget, helpstring("Get the specified text format")]
            HRESULT Item(
                            [in] VARIANT index, 
                            [out, retval] IDispatch** pValue);
            [id(0xfffffffc), propget, restricted]
            HRESULT _NewEnum([out, retval] IUnknown** lpUnknown);
        };
    
        [
          uuid(ADBE2D95-CA29-4E96-AB32-CBF83931A7E0),
          noncreatable
        ]
        coclass ExportTextFormats {
            [default] interface IExportTextFormats;
        };
    
        [
          odl,
          uuid(95AC3C81-64DB-44B8-92BB-50FD615C9A33),
          dual,
          oleautomation
        ]
        interface IExportTextFormat : IDispatch {
            [id(0x00000001), propget, helpstring("Name of format")]
            HRESULT Name([out, retval] BSTR* pValue);
            [id(0x00000002), propget, helpstring("ID of format")]
            HRESULT FormatID([out, retval] long* pValue);
            [id(0x00000003), propget, helpstring("File extension")]
            HRESULT Extension([out, retval] BSTR* pValue);
            [id(0x00000004), helpstring("Set as default export text format")]
            HRESULT Set([out, retval] long* Error);
            [id(0x00000005), propget, helpstring("Output format level capability")]
            HRESULT FormatLevelCapa([out, retval] long* pValue);
        };
    
        [
          uuid(27FDE7FF-6FCD-4389-BE77-1412E499CB8C),
          noncreatable
        ]
        coclass ExportTextFormat {
            [default] interface IExportTextFormat;
        };
    
        [
          odl,
          uuid(FB306D5E-9ED5-42EC-A2D6-0684EA0D8B48),
          dual,
          oleautomation
        ]
        interface IOPLanguages : IDispatch {
            [id(0x00000001), propget, helpstring("Get number of supported languages")]
            HRESULT Count([out, retval] long* Value);
            [id(0x00000002), propget, helpstring("Get the specified OCR language")]
            HRESULT Item(
                            [in] VARIANT index, 
                            [out, retval] IDispatch** pValue);
            [id(0xfffffffc), propget, restricted]
            HRESULT _NewEnum([out, retval] IUnknown** lpUnknown);
        };
    
        [
          uuid(A6AC04EF-E8C7-48CC-9BBB-A7E5618903FB),
          noncreatable
        ]
        coclass OPLanguages {
            [default] interface IOPLanguages;
        };
    
        [
          odl,
          uuid(3F30BD8A-D25B-439F-A540-3B7B1BCC637A),
          dual,
          oleautomation
        ]
        interface IOPLanguage : IDispatch {
            [id(0x00000001), propget, helpstring("Name of language")]
            HRESULT Name([out, retval] BSTR* pValue);
            [id(0x00000002), propget, helpstring("Identifier of language")]
            HRESULT Identifier([out, retval] long* pValue);
            [id(0x00000003), propget, helpstring("Is this language selected as OCR language")]
            HRESULT OCRLanguage([out, retval] VARIANT_BOOL* pValue);
            [id(0x00000003), propput, helpstring("Is this language selected as OCR language")]
            HRESULT OCRLanguage([in] VARIANT_BOOL pValue);
            [id(0x00000004), propget, helpstring("Is this language can be UI language")]
            HRESULT UILanguageCapa([out, retval] VARIANT_BOOL* Value);
            [id(0x00000005), propget, helpstring("Is this language installed as UI language")]
            HRESULT UILanguage([out, retval] VARIANT_BOOL* Value);
            [id(0x00000006), helpstring("Install this language as UI language")]
            HRESULT SetUILanguage([out, retval] long* Error);
        };
    
        [
          uuid(7C5682ED-4D60-4DF1-BE5A-FDAE872CDE89),
          noncreatable
        ]
        coclass OPLanguage {
            [default] interface IOPLanguage;
        };
    
        [
          odl,
          uuid(FDE21621-BE30-4F3F-81E8-549808269206),
          dual,
          oleautomation
        ]
        interface IImageFormats : IDispatch {
            [id(0x00000001), propget, helpstring("Get number of supported image fileformats")]
            HRESULT Count([out, retval] long* Value);
            [id(0x00000002), propget, helpstring("Get the specified image fileformat")]
            HRESULT Item(
                            [in] VARIANT index, 
                            [out, retval] IDispatch** pValue);
            [id(0xfffffffc), propget, restricted]
            HRESULT _NewEnum([out, retval] IUnknown** lpUnknown);
        };
    
        [
          uuid(D72D0944-D17C-482C-848F-E9094F9D2BE1),
          noncreatable
        ]
        coclass ImageFormats {
            [default] interface IImageFormats;
        };
    
        [
          odl,
          uuid(3A37E6A9-591B-4C6F-8BD8-7FBFC8BCA494),
          dual,
          oleautomation
        ]
        interface IImageFormat : IDispatch {
            [id(0x00000001), propget, helpstring("Reference name of the image format")]
            HRESULT Name([out, retval] BSTR* Value);
            [id(0x00000002), propget, helpstring("Identifier of the image format")]
            HRESULT Identifier([out, retval] long* pValue);
            [id(0x00000003), propget, helpstring("Is Multi-page file supported")]
            HRESULT MultipageFormat([out, retval] VARIANT_BOOL* pValue);
            [id(0x00000004), propget, helpstring("Default extension of the file ")]
            HRESULT Extension([out, retval] BSTR* pValue);
            [id(0x00000005), helpstring("Set the current image format for export")]
            HRESULT Set([out, retval] long* Error);
        };
    
        [
          uuid(45D250F6-E3B1-46BC-9A97-B71AD2665220),
          noncreatable
        ]
        coclass ImageFormat {
            [default] interface IImageFormat;
        };
    
        [
          odl,
          uuid(5C4A011E-6739-4C0C-BA4A-8FBE0C8443AC),
          dual,
          oleautomation
        ]
        interface IWorkflows : IDispatch {
            [id(0x00000001), propget, helpstring("Get number of available workflows")]
            HRESULT Count([out, retval] long* pValue);
            [id(0x00000002), propget, helpstring("Get the specified workflow")]
            HRESULT Item(
                            [in] VARIANT index, 
                            [out, retval] IDispatch** pValue);
            [id(0xfffffffc), propget, restricted]
            HRESULT _NewEnum([out, retval] IUnknown** lpUnknown);
        };
    
        [
          uuid(1938A307-7FD2-4425-BBDE-F1ED73D76669),
          noncreatable
        ]
        coclass Workflows {
            [default] interface IWorkflows;
        };
    
        [
          odl,
          uuid(3F48BF0E-51F5-4CD4-A847-FDF9CCB1AC70),
          dual,
          oleautomation
        ]
        interface IWorkflow : IDispatch {
            [id(0x00000001), propget, helpstring("Name of workflow")]
            HRESULT Name([out, retval] BSTR* pValue);
            [id(0x00000002), propget, helpstring("File name of workflow")]
            HRESULT Filename([out, retval] BSTR* pValue);
            [id(0x00000003), propget, helpstring("Is file loading workflow")]
            HRESULT FileInput([out, retval] VARIANT_BOOL* pValue);
            [id(0x00000004), propget, helpstring("Is OPD opening workflow")]
            HRESULT OPDInput([out, retval] VARIANT_BOOL* pValue);
            [id(0x00000005), propget, helpstring("Is scanning workflow")]
            HRESULT ScannerInput([out, retval] VARIANT_BOOL* pValue);
            [id(0x00000006), propget, helpstring("Is preprocessing step in workflow")]
            HRESULT PreprocessingStep([out, retval] VARIANT_BOOL* pValue);
            [id(0x00000007), propget, helpstring("Is zoning step in workflow")]
            HRESULT ZoningStep([out, retval] VARIANT_BOOL* pValue);
            [id(0x00000008), propget, helpstring("Is proofing step in workflow")]
            HRESULT ProofingStep([out, retval] VARIANT_BOOL* pValue);
            [id(0x00000009), propget, helpstring("Is input file name specified")]
            HRESULT InputFileNameSpecified([out, retval] VARIANT_BOOL* pValue);
        };
    
        [
          uuid(31821BD4-EA9F-4417-90D8-31C7AB8EE1D7),
          noncreatable
        ]
        coclass Workflow {
            [default] interface IWorkflow;
        };
    
        [
          odl,
          uuid(D045D78B-C358-4F73-AB98-FFDFB6988663),
          dual,
          oleautomation
        ]
        interface IOPScanner : IDispatch {
            [id(0x00000001), helpstring("Check scanner existance")]
            HRESULT IsScannerAvailable([out, retval] VARIANT_BOOL* Value);
            [id(0x00000002), helpstring("Is scanner in TWAIN Basic mode")]
            HRESULT IsTWAINBasicMode([out, retval] VARIANT_BOOL* Value);
            [id(0x00000003), propget, helpstring("Is scanner brightness adjustable")]
            HRESULT BrightnessCap([out, retval] VARIANT_BOOL* Value);
            [id(0x00000004), propget, helpstring("Is scanner contrast adjustable")]
            HRESULT ContrastCap([out, retval] VARIANT_BOOL* Value);
            [id(0x00000005), propget, helpstring("Get available paper-sizes")]
            HRESULT PaperSizeCap([out, retval] long* Value);
            [id(0x00000006), propget, helpstring("Is Automatic Document Feeder installed")]
            HRESULT ADFCap([out, retval] VARIANT_BOOL* Value);
            [id(0x00000007), propget, helpstring("Get scanning mode capability (Color, Gray, BW)")]
            HRESULT ScanModeCap([out, retval] long* Value);
            [id(0x00000008), propget, helpstring("Get current brightness value")]
            HRESULT Brightness([out, retval] short* Value);
            [id(0x00000008), propput, helpstring("Get current brightness value")]
            HRESULT Brightness([in] short Value);
            [id(0x00000009), propget, helpstring("Get current contrast value")]
            HRESULT Contrast([out, retval] short* Value);
            [id(0x00000009), propput, helpstring("Get current contrast value")]
            HRESULT Contrast([in] short Value);
            [id(0x0000000a), propget, helpstring("Get scanning resolution")]
            HRESULT Resolution([out, retval] SCANRESOLUTION* Value);
            [id(0x0000000a), propput, helpstring("Get scanning resolution")]
            HRESULT Resolution([in] SCANRESOLUTION Value);
            [id(0x0000000b), propget, helpstring("Get scanning mode")]
            HRESULT SCANMODE([out, retval] SCANMODE* Value);
            [id(0x0000000b), propput, helpstring("Get scanning mode")]
            HRESULT SCANMODE([in] SCANMODE Value);
            [id(0x0000000c), propget, helpstring("Get paper size")]
            HRESULT PAPERSIZE([out, retval] PAPERSIZE* PAPERSIZE);
            [id(0x0000000c), propput, helpstring("Get paper size")]
            HRESULT PAPERSIZE([in] PAPERSIZE PAPERSIZE);
            [id(0x0000000d), propget, helpstring("Get paper orientation")]
            HRESULT PageOrientation([out, retval] ORIENTATION* Value);
            [id(0x0000000d), propput, helpstring("Get paper orientation")]
            HRESULT PageOrientation([in] ORIENTATION Value);
        };
    
        [
          uuid(36BEB57B-5895-488E-9F5A-20C8D7D981A2),
          noncreatable
        ]
        coclass OPScanner {
            [default] interface IOPScanner;
        };
    
        [
          odl,
          uuid(B7868728-2641-4BFC-B160-55BE16BB7A6A),
          dual,
          oleautomation
        ]
        interface IOPProgress : IDispatch {
            [id(0x00000001), helpstring("Start progress monitor")]
            HRESULT Start([in] long proctype);
            [id(0x00000002), helpstring("Progress monitor")]
            HRESULT Progress(
                            [in] long proctype, 
                            [in] long percent, 
                            [out, retval] long* CanContinue);
            [id(0x00000003), helpstring("Page number currently is under processing")]
            HRESULT SetPageNumber([in] long proctype);
            [id(0x00000004), helpstring("Progress monitor")]
            HRESULT Stop([in] long proctype);
        };
    };
    Mias bon je vais t'avouer que je comprend pas grand chose

  13. #13
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 379
    Points : 41 573
    Points
    41 573
    Par défaut
    OK, j'ai vu pourquoi tu n'avais pas de header, c'est parce que tout est dans le bloc "library".
    Pour régénérer le .h, tu dois mettre en commentaire tout le début du bloc et rajouter import "oaidl.idl"; avant :
    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
    // Generated .IDL file (by the OLE/COM Object Viewer)
    // 
    // typelib filename: <could not determine filename>
    import "oaidl.idl";
    
    //[
    //  uuid(22996F69-B06F-4F22-A9D9-CD2D48C55362),
    //  version(1.0),
    //  custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 100663657),
    //  custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1181558890),
    //  custom(DE77BA65-517C-11D1-A2DA-0000F8773CE9, "Created by MIDL version 6.00.0361 at Mon Jun 11 12:48:10 2007")
    //]
    //library OmniPage15
    //{
    //	// TLib :     // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
    //	importlib("stdole2.tlb");
    
    	// Forward declare all types defined in this typelib
    	interface IApplication;
    	interface IProcess;
    	interface IProcessWF;
    	dispinterface _DOPProgress;
    	interface IExportTextFormats;
    	interface IExportTextFormat;
    	interface IOPLanguages;
    	interface IOPLanguage;
    	interface IImageFormats;
    	interface IImageFormat;
    	interface IWorkflows;
    	interface IWorkflow;
    	interface IOPScanner;
    	interface IOPProgress;
    Et n'oublie pas de mettre également en commentaire l'accolade de fin du bloc, tout en bas du fichier.

  14. #14
    Membre du Club
    Inscrit en
    Juillet 2008
    Messages
    117
    Détails du profil
    Informations forums :
    Inscription : Juillet 2008
    Messages : 117
    Points : 58
    Points
    58
    Par défaut
    J'ai suivi ta procédure à la lettre (franchement chapeau, j'aurais jamais trouver ça tout seul).
    Mais j'ai 1 erreur qui m'empêche de compiler (ainsi qu'un warning) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    error MIDL2025 : syntaxe error : expecting ; or , "near interface"
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    warning MIDL2214 : semantic check incomplete due to previous errors
    Apparemment il aime pas qu'on lui enlève l'accolade de library.

  15. #15
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 379
    Points : 41 573
    Points
    41 573
    Par défaut
    Eh bien je ne comprends pas, chez moi MIDL compile ceci sans problème...
    Fichiers attachés Fichiers attachés

  16. #16
    Membre du Club
    Inscrit en
    Juillet 2008
    Messages
    117
    Détails du profil
    Informations forums :
    Inscription : Juillet 2008
    Messages : 117
    Points : 58
    Points
    58
    Par défaut
    Erreur classique, j'avais oublier le ";" derrière
    Je suis impardonnable !

    En tout cas merci beaucoup pour ton aide. Je passe le sujet en résolu.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Utilisation d'un .tlb en C
    Par dewey01 dans le forum Débuter
    Réponses: 1
    Dernier message: 30/10/2008, 17h02
  2. utiliser les tag [MFC] [Win32] [.NET] [C++/CLI]
    Par hiko-seijuro dans le forum Visual C++
    Réponses: 8
    Dernier message: 08/06/2005, 15h57
  3. utilisation du meta type ANY
    Par Anonymous dans le forum CORBA
    Réponses: 1
    Dernier message: 15/04/2002, 12h36
  4. [BCB5] Utilisation des Ressources (.res)
    Par Vince78 dans le forum C++Builder
    Réponses: 2
    Dernier message: 04/04/2002, 16h01
  5. Réponses: 2
    Dernier message: 20/03/2002, 23h01

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