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

Qt Creator Discussion :

Problème d'édition des liens d'une DLL


Sujet :

Qt Creator

  1. #1
    Nouveau Candidat au Club
    Inscrit en
    Mai 2011
    Messages
    4
    Détails du profil
    Informations forums :
    Inscription : Mai 2011
    Messages : 4
    Points : 1
    Points
    1
    Par défaut Problème d'édition des liens d'une DLL
    Bonjour à tous!

    J’espère beaucoup de ce post pour me sortir de la panade! Je suis vraiment bloqué ici, peu être l'un de vous pourra m'aider!

    Voila le problème:

    J’essaie d'utiliser sous Qt une dll open source DDEClient.dll qui permet d'échanger des informations avec un serveur DDE.

    Dans mon .pro, j'ai inclue:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    win32:LIBS += \
        C:/NOM_DU_PROJET/Extern/DDEClient.lib
    Mais j'ai des erreurs à la compilation.

    Voila la sortie de compilation ou on trouve notamment: undefined reference to `_imp__DCDA'

    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
    Exécution des étapes de compilation pour le projet NOM_DU_PROJET...
    Configuration inchangée, étape QMake sautée.
    Commence : "C:\QtSDK\mingw\bin\mingw32-make.exe" 
    C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory `C:/NOM_DU_PROJET-build-desktop'
    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\NOM_DU_PROJET.exe debug/main.o debug/p...ETC...
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: Offset (4448) greater than or equal to (null) size (4954657).
    C:/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x629): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
    C:/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x655): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '20039', this reader only handles version 2 and 3 information.
    C:/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x8ed): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '11075', this reader only handles version 2 and 3 information.
    C:/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0xabc): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '11828', this reader only handles version 2 and 3 information.
    C:/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0xca6): undefined reference to `_imp__DCDA'
    collect2: ld returned 1 exit status
    mingw32-make[1]: Leaving directory `C:/NOM_DU_PROJET-build-desktop'
    mingw32-make[1]: *** [debug\NOM_DU_PROJET.exe] Error 1
    mingw32-make: *** [debug] Error 2
    Le processus "C:\QtSDK\mingw\bin\mingw32-make.exe" s'est terminé avec le code 2.
    Erreur à la compilation du projet NOM_DU_PROJET (cible : Desktop)
    Lors de l'exécution de l'étape 'Make'
    Voila le header de la dll, DDEClient.h (inclus dans DDE_IF.h).
    Ici on peut voir ligne 33 la déclaration du pointeur DCDA dont le nom revient dans les erreurs de compilation: DCDllImport DCDATAACCESS* *DCDA;

    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
    // Header for using DDEClient.dll in other C/C++ programs
    //
    // Author:  Robert Matovinovic
    // Version: 0.02
    // Date:    04.10.2006
    //
     
    // DDE data structure for access data received by DDE transaction
    typedef struct {
    	// pointer to begin of dde data returned by DdeAccessData
    	BYTE* pData;
    	// length of dde data returned by DdeAccessData
    	DWORD dwLen;
    	// string pointer to dde data, if the data should accessed as string
    	char* pszData;
    	// ID of transaction, used to determine completion of asynchronous transaction
    	DWORD dwTransID;
    	// ID of transaction, returned by callback function with asynch. transaction
    	DWORD dwCbTransID;
    	// string for access type of data
    	char szAccType[6];
    } DCDATAACCESS;
     
    #define DCDllImport extern "C" __declspec( dllimport )
     
    // Imported variables:
    // boolean used by DCLastError
    DCDllImport bool bDCErrorExport;
    // pointer to dde data access structure
    DCDllImport DCDATAACCESS* *DCDA;
     
    // Imported functions:
    // short form of DCTransaction for string request transaction
    DCDllImport bool DCRequestString(WORD wC, char szItem[], int nTimeout);
    // procedure for DDE request giving back a pointer to the data
    DCDllImport bool DCRequest(WORD wC, char szItem[], char szFormat[], int nTimeout );
    // Do a DDE Transaction
    DCDllImport bool DCTransaction(WORD wC, char szType[], char szItem[], char szData[], char szFormat[], int nTimeout, char szAccess[]);
    // Initiate a conversation with the server application on a topic
    // If server is not found, ask to launch it. If either server could 
    // not be launched or topic is not found give an error message.
    DCDllImport bool DCConnect(WORD* pConvNo, char szService[], char szTopic[]);
    // procedure which disconnects a DDE connection
    DCDllImport bool DCDisconnect(WORD wConvNo);
    // procedure for initializing DDEML.DLL
    DCDllImport bool DCInit();
    // procedure which uninitializes DDEML.DLL
    DCDllImport bool DCUninit();
    // procedure which gives back the message of last error.
    // By bDCErrorExport is decided whether the message is the return value of
    // the function or displayed in a message box.
    // The length of the message is is determined by the size of szErrorMsg.
    // If the message is longer than sizeof(szErrorMsg) it will be cut off,
    // and a comment is given.
    DCDllImport char* DCLastError();
    // procedure which determines if a certain asynchronous transaction
    // has completed. Only to use for one transaction at a time, because
    // messages from other transactions will be ignored. Procedure enables
    // quasi synchronous behavior for asynchronous request, if called
    // after transaction call. To use if in between a transaction is processed
    // by a server some other calculations shall be done in the program without
    // waiting for the server to finish the transaction. After the calculations
    // this procedure can be called. If the server has finished it returns true,
    // if not false. 
    // bWait:	controls, if the procedure shall wait until the transaction is
    //			finished (true) or only check once for completion (false).
    DCDllImport bool DCAsynchTransactionCompleted(WORD wC, DWORD dwTransID, bool bWait);
    // procedure which frees handles of the DDE conversation and memory associated
    // with the last transaction. Has has to be called after each transaction 
    // especially after transactions which give back data.
    // Important: After data handle is freed no pointer can access the data.
    // Therefore it has to be processed or copied to another buffer before.
    DCDllImport bool DCFreeDdeMem(WORD wC);
    // procedure which frees memory, to be called before ending dll access.
    DCDllImport void DCFinalize();
    // procedure to abandon an asynchronous transaction
    // takes the conversation number and the transaction id
    DCDllImport bool DCAbandonTransaction(WORD wC, DWORD dwTransID);
    // procedure which gives back the version of this dll
    DCDllImport char* DCVersion();
     
    /*In DDEClient.cpp there is://
    // Exported variables:
    // boolean used by DCLastError for appearance of error messages.
    // false: Messages are shown in a system message box.
    // true: Messages are passed to the calling program.
    DllExport bool bDCErrorExport = false;
    // pointer to an pointer array to dde data access variables
    DllExport DCDATAACCESS* *DCDA = DDA;
     
    // Exported functions:
    DllExport bool DCRequestString(WORD wC, char szItem[], DWORD dwTimeout);
    DllExport bool DCRequest(WORD wC, char szItem[], char szFormat[], DWORD dwTimeout );
    DllExport bool DCTransaction(WORD wC, char szType[], char szItem[], char szData[], char szFormat[], DWORD dwTimeout, char szAccess[]);
    DllExport bool DCConnect(WORD* pConvNo, char* szService, char* szTopic);
    DllExport bool DCDisconnect(WORD wC);
    DllExport bool DCInit();
    DllExport bool DCUninit();
    DllExport char* DCLastError();
    DllExport bool DCAsynchTransactionCompleted(WORD wC, DWORD dwTransID, bool bWait);
    DllExport bool DCFreeDdeMem(WORD wC);
    DllExport void DCFinalize();
    DllExport bool DCAbandonTransaction(WORD wC, DWORD dwTransID);
    DllExport char* DCVersion();*/
    DDEClient.cpp:
    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
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
    903
    904
    905
    906
    907
    908
    909
    910
    911
    912
    913
    914
    915
    916
    917
    918
    919
    920
    921
    922
    923
    924
    925
    926
    927
    928
    929
    930
    931
    932
    933
    934
    935
    936
    937
    938
    939
    940
    941
    942
    943
    944
    945
    946
    947
    948
    949
    950
    951
    952
    953
    954
    955
    956
    957
    958
    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    969
    970
    971
    972
    973
    974
    975
    976
    977
    978
    979
    980
    981
    982
    983
    984
    985
    986
    987
    988
    989
    990
    991
    992
    993
    994
    995
    996
    997
    998
    999
    1000
    1001
    1002
    1003
    1004
    1005
    1006
    1007
    1008
    1009
    1010
    1011
    1012
    1013
    1014
    1015
    1016
    1017
    1018
    1019
    1020
    1021
    1022
    1023
    1024
    1025
    1026
    1027
    1028
    1029
    1030
    1031
    1032
    1033
    1034
    1035
    1036
    1037
    1038
    1039
    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    1048
    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    1057
    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    1067
    1068
    1069
    1070
    1071
    1072
    1073
    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    1085
    1086
    1087
    1088
    1089
    1090
    1091
    1092
    1093
    1094
    1095
    1096
    1097
    1098
    1099
    1100
    1101
    1102
    1103
    1104
    1105
    1106
    1107
    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    1128
    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    // This file defines a DLL, which exports procedures for DDE client connections
    // to server applications. 
    // The base of the procedures are several articles from Mircosoft about DDE and
    // different examples of code found via internet search. The code examples did 
    // not work in Visual Studio .NET 2003 and had to be revised substantially.
    //
    // Author:  Robert Matovinovic
    // Version: 0.03
    // Date:    14.10.2006
    //
    // 0.01
    // DLL supports only a single connection. For multiple connections the variables
    // must be localized to procedures. Synchronous and asynchronous transactions are 
    // possible. To access data of asynchronous transactions call 
    // DCAsynchTransactionCompleted
    //
    // 0.02
    // multiple connections realized by use of individual conversation handle and 
    // separated variables
    //
    // 0.03
    // bug fixed which caused an infinite loop in DCAsynchTransactionCompleted
     
    // DDEClient.cpp : Entry point for DLL application.
    //
     
    #pragma once
     
    #define WIN32_LEAN_AND_MEAN		// don't bind to seldom used parts of Windows-Header
    #include <windows.h>
    #include <ddeml.h>
    #include <atlstr.h>		// only for string handling of error messages
    #include "DCErrors.h"	// Error messages for dll
     
    #include <fstream>
     
    using namespace std;
     
     
     
    //
    // global data
    //
    char szVersion[]="DDEClient.dll, version 0.03, copyright Robert Matovinovic, robert.matovinovic@web.de";
    // variable of DDE instance
    DWORD dwDDEInst = 0;
    // data handle for execute transaction
    HDDEDATA hExecData;
    // string for messages
    CString csMsg; 
    // Flag for successful return of callback function
    bool bCbSuccess = true;
     
    // DDEClientTransaction data, variables for transactions via DDEML
    typedef struct {
    	// Pointer to the beginning of the data the client must pass to the server.
    	// can also be a data handle, for execute and poke.
    	LPBYTE pData; 
    	// Specifies the length, in bytes, of the data pointed to by the pData parameter
    	DWORD cbData;		
    	// Handle to the conversation in which the transaction is to take place.
    	HCONV hConv;		 
    	// Handle to the data item for which data is being 
    	// exchanged during the transaction.
    	HSZ hszItem;		
    	// Specifies the standard clipboard format 
    	// in which the data item is being submitted or requested.
    	UINT wFmt; 
    	// Specifies the transaction type.
    	UINT wType;
    	// Specifies the maximum length of time, in milliseconds, that the client will
    	// wait for a response from the server application in a synchronous transaction. 
    	// This parameter should be TIMEOUT_ASYNC for asynchronous transactions. 
    	DWORD dwTimeout;
    	// Pointer to a variable that receives the result of the transaction.
    	//LPDWORD pdwResult;
    	// Variable that receives the result of the transaction.
    	DWORD dwResult;
    	// Data handle for transactions 
    	HDDEDATA hData;
    } DDEVARS;
     
    // DDE data structure for access data received by DDE transaction
    typedef struct {
    	// pointer to begin of dde data returned by DdeAccessData
    	BYTE* pData;
    	// length of dde data returned by DdeAccessData
    	DWORD dwLen;
    	// string pointer to dde data, if the data should accessed as string
    	char* pszData;
    	// ID of transaction, used to determine completion of asynchronous transaction
    	DWORD dwTransID;
    	// ID of transaction, returned by callback function with asynch. transaction
    	DWORD dwCbTransID;
    	// string for access type of data
    	char szAccType[6];
    } DCDATAACCESS;
     
    // maximal number of dde conversations
    const WORD wCONVMAX = 20;
    // pointer array to dde conversation variables
    DDEVARS* DdeV[wCONVMAX];
    // pointer array to dde data access variables
    DCDATAACCESS* DDA[wCONVMAX];
     
    #define DllExport extern "C" __declspec( dllexport )
     
    //
    // exported variables
    //
    // boolean used by DCLastError for appearance of error messages.
    // false: Messages are shown in a system message box.
    // true: Messages are passed to the calling program.
    DllExport bool bDCErrorExport = false;
    // pointer to an pointer array to dde data access variables
    DllExport DCDATAACCESS* *DCDA = DDA;
     
     
    //
    // exported functions
    //
     
    DllExport bool DCRequestString (WORD wC, char szItem[], DWORD dwTimeout);
    DllExport bool DCRequest(WORD wC, char szItem[], char szFormat[], DWORD dwTimeout );
    DllExport bool DCTransaction (WORD wC, char szType[], char szItem[], char szData[], char szFormat[], DWORD dwTimeout, char szAccess[]);
    DllExport bool DCInit();
    DllExport bool DCConnect(WORD* pConvNo, char* szService, char* szTopic);
    DllExport bool DCDisconnect(WORD wC);
    DllExport bool DCUninit();
    DllExport bool DCFreeDdeMem(WORD wC);
    DllExport char* DCLastError();
    DllExport void DCFinalize();
    DllExport bool DCAsynchTransactionCompleted(WORD wC, DWORD dwTransID, bool bWait);
    DllExport bool DCAbandonTransaction(WORD wC, DWORD dwTransID);
    DllExport char* DCVersion();
     
     
     
    //
    // forward declarations
    //
    bool DdeDataHandling(WORD wC, HDDEDATA hData, char szAccess[]);
    void FreeData(WORD wC);
    bool InitDdeVars(HCONV hConv);
    bool InitDCDataAccess(WORD wC);
    WORD FindConvNo(HCONV hConv);
    bool GetConvNo(WORD* pConvNo);
    void FreeDdeV(WORD wC);
    void FreeDDA(WORD wC);
     
    //
    // Entry point for application
    //
    BOOL APIENTRY DllMain( HANDLE hModule, 
                           DWORD  ul_reason_for_call, 
                           LPVOID lpReserved
    					 )
    {
        //hMod = hModule;        // save our module handle
    	//InitDdeVars(0L);
    	//InitDCDataAccess();
     
        return true;
    }
     
    //
    // local functions
    //
     
    void FAR PASCAL WEP(WORD wGarbage)
    {
        //
        // Do absolutely nothing at all here, since    
        // that's all that is safe to do.
        //
    }
     
    // procedure which retrives the last DDE error and adds it to a CString
    UINT DCGetLastError(DWORD dwDdeInst, CString csMsgHead)
    {
    	UINT ui;
     
    	csMsg=csMsgHead;
     
    	ui = DdeGetLastError(dwDdeInst);
     
        if (ui != DMLERR_NO_ERROR) 
    	{
    		switch (ui)
    		{
    		case DMLERR_ADVACKTIMEOUT:  
    			csMsg = csMsg + (CString)ccDMLERR01;
    			break; 
    		case DMLERR_BUSY:  
    			csMsg = csMsg + (CString)ccDMLERR02;
    			break; 
    		case DMLERR_DATAACKTIMEOUT:  
    			csMsg = csMsg + (CString)ccDMLERR03;
    			break; 
    		case DMLERR_DLL_NOT_INITIALIZED:  
    			csMsg = csMsg + (CString)ccDMLERR04;
    			break; 
    		case DMLERR_DLL_USAGE:  
    			csMsg = csMsg + (CString)ccDMLERR05;
    			break; 
    		case DMLERR_EXECACKTIMEOUT:  
    			csMsg = csMsg + (CString)ccDMLERR06;
    			break; 
    		case DMLERR_INVALIDPARAMETER:  
    			csMsg = csMsg + (CString)ccDMLERR07;
    			break;
    		case DMLERR_LOW_MEMORY:  
    			csMsg = csMsg + (CString)ccDMLERR08;
    			break; 
    		case DMLERR_MEMORY_ERROR:  
    			csMsg = csMsg + (CString)ccDMLERR09;
    			break; 
    		case DMLERR_NO_CONV_ESTABLISHED:  
    			csMsg = csMsg + (CString)ccDMLERR10;
    			break; 
    		case DMLERR_NOTPROCESSED:  
    			csMsg = csMsg + (CString)ccDMLERR11;
    			break; 
    		case DMLERR_POKEACKTIMEOUT:  
    			csMsg = csMsg + (CString)ccDMLERR12;
    			break; 
    		case DMLERR_POSTMSG_FAILED:  
    			csMsg = csMsg + (CString)ccDMLERR13;
    			break; 
    		case DMLERR_REENTRANCY:  
    			csMsg = csMsg + (CString)ccDMLERR14;
    			break;
    		case DMLERR_SERVER_DIED:  
    			csMsg = csMsg + (CString)ccDMLERR15;
    			break;
    		case DMLERR_SYS_ERROR:  
    			csMsg = csMsg + (CString)ccDMLERR16;
    			break; 
    		case DMLERR_UNADVACKTIMEOUT:  
    			csMsg = csMsg + (CString)ccDMLERR17;
    			break; 
    		case DMLERR_UNFOUND_QUEUE_ID:  
    			csMsg = csMsg + (CString)ccDMLERR18;
    			break; 
    		}
        }
    	return ui;
    }
    //
    // Callback function for DDE messages
    //
     
    HDDEDATA CALLBACK DdeCallback(UINT wType, 
                                  UINT wFmt, 
                                  HCONV hConv,
                                  HSZ hsz1, 
                                  HSZ hsz2, 
                                  HDDEDATA hDDEData, 
                                  DWORD dwData1, 
                                  DWORD dwData2)
    {
    	bool bErrorExport;
    	WORD wC;
     
    	bCbSuccess = true;
    	wC = FindConvNo(hConv);
     
    	if (wType == XTYP_ADVDATA ) {
     
    		DDA[wC]->dwCbTransID = dwData1;
    		//DdeDataString(wC,hDDEData);
     
    		//char* pszDdeData = (char *) DdeAccessData(hDDEData, &DDA[wC]->dwLen);
     
    		char pszDdeData[255];
    		DdeGetData(hDDEData, (unsigned char *)pszDdeData, 255, 0);
     
     
    		ofstream fichier("DDEDLL.txt", ios::out | ios::trunc);  // ouverture en écriture avec effacement du fichier ouvert
     
    		if(fichier)
    		{
    			fichier << "DDEadvise: " <<  pszDdeData << endl;
    				fichier.close();
    		}
     
     
    	}
     
     
    	switch ( wType )
    	{
    	case XTYP_XACT_COMPLETE:
    		// store transaction ID
    		DDA[wC]->dwCbTransID = dwData1;
     
    		// Return doing nothing, if the transaction IDs are not equal
    		if ( dwData1 != DdeV[wC]->dwResult ) 
    		{
    			csMsg = ccMsgCbWrongID;
    			bCbSuccess = false;
    			return 0;
    		}
     
    		// Check for successful transaction
    		if ( !hDDEData )
    		{
    			csMsg = ccMsgCbTransactionFailed;
    			bCbSuccess = false;
    		}
    		// access DDE data for request transactions
    		else if ( DdeV[wC]->wType == XTYP_REQUEST )
    		{
    			if(!DdeDataHandling(wC, hDDEData, DDA[wC]->szAccType))
    			{
    				FreeData(wC);
    				csMsg = ccMsgCbAsynchRequestFailed;
    				bCbSuccess = false;
    			}
    		}
    		else bCbSuccess = true;
     
    		// do nothing for execute and poke transactions
     
    		DdeV[wC]->dwResult = 0;
     
    		//char szTemp[100];
    		//sprintf(szTemp,"bCbSuccess = %i  CbTransID = %i", bCbSuccess,DDA[wC]->dwCbTransID);
    		////MessageBox((HWND)GetActiveWindow(), szTemp, ccMsgCaptionCb, MB_OK);
     
    		return 0;
    	case XTYP_DISCONNECT:
    		DdeV[wC]->dwResult = 0;
    		//MessageBox((HWND)GetActiveWindow(), ccMsgAppTerminatedConv, ccMsgCaptionCb, MB_OK | MB_ICONERROR);
    		return 0;
     
     
    	case XTYP_ADVDATA:
    		return((HDDEDATA)DDE_FACK);
     
    	case XTYP_ERROR:
    		// only valid for one error (low memory)
    		// bDCErrorExport has to be set to false, otherwise the error is not shown.
    		// After that its previous state is restored
    		bErrorExport = bDCErrorExport;
    		bDCErrorExport = false;
    		DCGetLastError(dwDDEInst, csMsg);
    		bDCErrorExport = bErrorExport;
    		return 0;
    	default:
    		return 0;
     
     
    	}
    }
     
    //
    // Extract constant for format of DDE command
    // 
    UINT DDEFormat(char* szFormat)
    {
    	// Null-terminated, plain ANSI text in a global memory block.
    	if (0 == strnicmp (szFormat,"CF_TEXT",7)) 
    		return CF_TEXT;
    	// A bitmap compatible with Windows 2.x.
    	if (0 == strnicmp (szFormat,"CF_BITMAP",7)) 
    		return CF_BITMAP;
    	// A Windows metafile with some additional information about how the 
    	// metafile should be displayed.
    	if (0 == strnicmp (szFormat,"CF_METAFILEPICT",7)) 
    		return CF_METAFILEPICT;
    	// An ASCII text format used by some older Microsoft products.
    	if (0 == strnicmp (szFormat,"CF_SYLK",7)) 
    		return CF_SYLK;
    	// Software Art's data interchange format (DIF). Also an ASCII text format.
    	if (0 == strnicmp (szFormat,"CF_DIF",7)) 
    		return CF_DIF;
    	// Tag image file format (TIFF) data in a global memory block.
    	if (0 == strnicmp (szFormat,"CF_TIFF",7)) 
    		return CF_TIFF;
    	// Similar to CF_TEXT but using the OEM character set.
    	if (0 == strnicmp (szFormat,"CF_OEMTEXT",7)) 
    		return CF_OEMTEXT;
    	// A global memory block containing a Windows device-independent bitmap (DIB)
    	// as a BITMAPINFO structure followed by the bitmap bits.
    	if (0 == strnicmp (szFormat,"CF_DIB",7)) 
    		return CF_DIB;
    	// A color-palette handle. (Used in conjunction with CF_DIB.)
    	if (0 == strnicmp (szFormat,"CF_PALETTE",7)) 
    		return CF_PALETTE;
    	// Data is for the pen extensions to Windows.
    	if (0 == strnicmp (szFormat,"CF_PENDATA",7)) 
    		return CF_PENDATA;
    	// Resource interchange file format (RIFF) data as a global memory block.
    	if (0 == strnicmp (szFormat,"CF_RIFF",7)) 
    		return CF_RIFF;
    	// A specific case of RIFF in which the contained data is a waveform (sampled sound).
    	if (0 == strnicmp (szFormat,"CF_WAVE",7)) 
    		return CF_WAVE;
     
    	return 0;
    }
    //
    // Extract constant or time for timeout of DDE command
    // 
    DWORD DDETimeout(DWORD* pdwTimeout)
    {
    	if (*pdwTimeout > 0) 
    	{
    		return *pdwTimeout;
    	}
    	return TIMEOUT_ASYNC;
    }
    //
    // Set Parameters for DDEClientTransaction considering the type of command
    //
    void SetDDEParams(WORD wC, char* szType, char* szItem,  
    				  char* szData, char* szFormat, DWORD* pdwTimeout)
    {
    	UINT wCmdLen = lstrlen((LPCWSTR)szItem)+1;
     
    	if (0 == strnicmp (szType,"execute",7)) 
    	{
    		DdeV[wC]->wType = XTYP_EXECUTE;
    		DdeV[wC]->wFmt = 0;
    		// Create a data handle for the exec string
    		hExecData = DdeCreateDataHandle(dwDDEInst,
    										(LPBYTE)szItem,
    										wCmdLen,
    										0,
    										NULL,
    										DdeV[wC]->wFmt,
    										0);
    		DdeV[wC]->pData = (LPBYTE)hExecData;
    		DdeV[wC]->cbData = -1;
    		DdeV[wC]->hszItem = NULL;
    		DdeV[wC]->dwTimeout = DDETimeout(pdwTimeout);
    		//DdeV[wC]->pdwResult = NULL;
    		DdeV[wC]->dwResult = 0;
    		return;
    	}
    	if (0 == strnicmp (szType,"poke",4)) 
    	{
    		DdeV[wC]->wType = XTYP_POKE;
    		DdeV[wC]->wFmt = DDEFormat(szFormat);
    		DdeV[wC]->pData = (LPBYTE)szData;
    		DdeV[wC]->cbData = strlen(szData)+1;
    		DdeV[wC]->hszItem = DdeCreateStringHandle(dwDDEInst, (LPCWSTR)szItem, CP_WINANSI );
    		DdeV[wC]->dwTimeout = DDETimeout(pdwTimeout);
    		//DdeV[wC]->pdwResult = NULL;
    		DdeV[wC]->dwResult = 0;
    		return;
    	}
    	if (0 == strnicmp (szType,"request",7)) 
    	{
    		DdeV[wC]->wType = XTYP_REQUEST;
    		DdeV[wC]->pData = NULL;
    		DdeV[wC]->cbData = 0;
    		DdeV[wC]->hszItem = DdeCreateStringHandle(dwDDEInst, (LPCWSTR)szItem, CP_WINANSI );
    		DdeV[wC]->wFmt = DDEFormat(szFormat);
    		DdeV[wC]->dwTimeout = DDETimeout(pdwTimeout);
    		DdeV[wC]->dwResult = 0;
    		return ;
    	}
     
    	if (0 == strnicmp (szType,"advise_start",12)) 
    	{
    		DdeV[wC]->wType = XTYP_ADVSTART;
    		DdeV[wC]->pData = NULL;
    		DdeV[wC]->cbData = 0;
    		DdeV[wC]->hszItem = DdeCreateStringHandle(dwDDEInst, (LPCWSTR)szItem, CP_WINANSI );
    		DdeV[wC]->wFmt = DDEFormat(szFormat);
    		DdeV[wC]->dwTimeout = DDETimeout(pdwTimeout);
    		DdeV[wC]->dwResult = 0;
    		return ;
     
    	}
    	if (0 == strnicmp (szType,"advise_stop",11)) 
    	{
    		//return XTYP_ADVSTOP;
    	}
     
    }
     
    // procedure retriving DDE Data as string.
    bool DdeDataString(WORD wC, HDDEDATA hData)
    {
    	if (!hData) return false;
    	else
    	{
    		// get the data as string		
    		char* pszDdeData = (char *) DdeAccessData(hData, &DDA[wC]->dwLen);
    		if(pszDdeData)
    		{
    			// store data in a new array, otherwise it is lost with
    			// asynchronous transactions
    			DDA[wC]->pszData = (char *)malloc(DDA[wC]->dwLen);
    			char* pszData = DDA[wC]->pszData;
    			for (DWORD i = 0; i < DDA[wC]->dwLen; i++) 
    				pszData[i] = *pszDdeData++; 
    			DdeUnaccessData( hData );
    			return true;
    		}
    		else
    			return false;
    	}
    }
     
    // short form of DCTransaction for string request transaction
    bool DCRequestString(WORD wC, char szItem[], DWORD dwTimeout)
    {
    	csMsg = "";
    	DdeV[wC]->wType = XTYP_REQUEST;
    	DdeV[wC]->dwTimeout = DDETimeout(&dwTimeout);
     
        // Send the request
    	DdeV[wC]->hData = DdeClientTransaction(NULL, 0, DdeV[wC]->hConv, 
    						DdeCreateStringHandle(dwDDEInst, (LPCWSTR)szItem, CP_WINANSI ), 
    						CF_TEXT, 
    						DdeV[wC]->wType, 
    						DdeV[wC]->dwTimeout, 
    						&(DdeV[wC]->dwResult));
     
    	// store transaction ID
    	DDA[wC]->dwTransID = DdeV[wC]->dwResult;
    	// Check for DDE data
    	if (DdeV[wC]->hData==NULL)
    	{
    		csMsg = (CString)ccMsgRequestFailed + szItem;
    		return 0;
    	}
    	else
    	{
    		if (DdeV[wC]->dwTimeout != TIMEOUT_ASYNC)
    		{
    			// data access for synchronous transactions
    			if(!DdeDataString(wC,DdeV[wC]->hData))
    			{
    				FreeData(wC);
    				csMsg = (CString)ccMsgRequestFailed + szItem;
    				return false;
    			}
    			else return true;
    		}
    		else
    		{
    			strncpy(DDA[wC]->szAccType,"string",sizeof(DDA[wC]->szAccType));
    		}
    	}
    	return true;
    }
     
     
    // procedure retrieving DDE data as byte array
    bool DdeDataBytes(WORD wC, HDDEDATA hData)
    {
    	// Check for DDE data
    	if (hData==NULL)
    		{
    			DDA[wC]->pData = NULL;
    			DDA[wC]->dwLen = NULL;
    			return false;
    		}
    		else
    		{
    			// Get data		
    			BYTE* pDdeData = DdeAccessData(hData, &DDA[wC]->dwLen);
    			if(pDdeData)
    			{
    				// store data in a new array, otherwise it is lost with
    				// asynchronous transactions
    				DDA[wC]->pData = (BYTE *)malloc(DDA[wC]->dwLen);
    				BYTE* pData = DDA[wC]->pData;
    				for (DWORD i = 0; i < DDA[wC]->dwLen; i++) 
    					pData[i] = *pDdeData++; 
    				DdeUnaccessData( hData );
    				return true;
    			}
    			else
    				return false;
    		}	
    }
     
     
    // procedure for DDE request giving back a pointer to the data
    bool DCRequest(WORD wC, char szItem[], char szFormat[], DWORD dwTimeout )
    {
    	csMsg = "";
    	// Set parameters for a single DDE conversation
    	SetDDEParams(wC, "request", szItem, NULL, szFormat, &dwTimeout);
     
        // Send the request
    	DdeV[wC]->hData = DdeClientTransaction(DdeV[wC]->pData, 
    											DdeV[wC]->cbData, 
    											DdeV[wC]->hConv, 
    											DdeV[wC]->hszItem, 
    											DdeV[wC]->wFmt, 
    											DdeV[wC]->wType, 
    											DdeV[wC]->dwTimeout, 
    											&(DdeV[wC]->dwResult));
     
    	// store transaction ID
    	DDA[wC]->dwTransID = DdeV[wC]->dwResult;
     
    	if (DdeV[wC]->dwTimeout != TIMEOUT_ASYNC)
    	{
    		// data access for synchronous transaction
    		if(!DdeDataBytes(wC, DdeV[wC]->hData))
    		{
    			FreeData(wC);
    			csMsg = (CString)ccMsgRequestFailed + szItem;
    			return false;
    		}
    		else return true;
    	}
    	else
    	{
    		strncpy(DDA[wC]->szAccType,"byte",sizeof(DDA[wC]->szAccType));
    	}
    	return true;
    }
     
    // Initialize data structure for dde variables
    bool InitDdeVars(HCONV hConv, WORD wC)
    {
    	// assign memory for conversation variables
    	DdeV[wC] = (DDEVARS *)malloc(sizeof(DDEVARS));
     
    	if (DdeV[wC] == NULL)
    	{
    		csMsg = (CString)ccMsgNotEnoughMemory01;
    		return false;
    	}
    	memset(DdeV[wC], 0, sizeof(DdeV[wC]));
    	DdeV[wC]->hConv = hConv;
    	return true;
    }
     
    // Initialize data structure for dde data access
    bool InitDCDataAccess(WORD wC)
    {
    	// assign memory for data access variables
    	DDA[wC] = (DCDATAACCESS *)malloc(sizeof(DCDATAACCESS));
    	if (DDA[wC] == NULL)
    	{
    		csMsg = (CString)ccMsgNotEnoughMemory02;
    		return false;
    	}
     
    	DDA[wC]->pData = NULL;
    	DDA[wC]->dwLen = 0;
    	DDA[wC]->pszData = NULL;
    	strncpy(DDA[wC]->szAccType,"string",sizeof(DDA[wC]->szAccType));
    	DDA[wC]->dwTransID = 0;
    	DDA[wC]->dwCbTransID = 0;
    	return true;
    }
     
     
    // Initiate a conversation with the server application on a topic
    // If server is not found, ask to launch it. If either server could 
    // not be launched or topic is not found give an error message.
    bool DCConnect (WORD* pConvNo, char* szService, char* szTopic)
    {
        HSZ hszDDEServer;
    	HSZ hszTopic;
    	HCONV hConv;
     
    	csMsg = "";
     
    	// Get server application handle
    	hszDDEServer = DdeCreateStringHandle(dwDDEInst, (LPCWSTR)szService, CP_WINANSI );
    	// Get topic handle
    	hszTopic = DdeCreateStringHandle(dwDDEInst, (LPCWSTR)szTopic, CP_WINANSI);
    	// Get conversation handle
    	hConv = DdeConnect(dwDDEInst, hszDDEServer, hszTopic, NULL);
     
        DdeFreeStringHandle(dwDDEInst, hszDDEServer);
        DdeFreeStringHandle(dwDDEInst, hszTopic);
     
    	if(hConv == 0L)
    	{
    		csMsg = (CString)ccMsgConnectFailed01 + szService +
    				(CString)ccMsgConnectFailed02 + szTopic +
    				(CString)ccMsgConnectFailed03;
    		return 0;
    	}
     
    	// determine conversation number
    	if(!GetConvNo(pConvNo))
    		return false;
    	// init variables neccessary for conversation
    	if(!InitDdeVars(hConv, *pConvNo)) 
    	{
    		FreeDdeV(*pConvNo);
    		return false;
    	}
    	else
    	{
    		if(!InitDCDataAccess(*pConvNo)) 
    		{
    			FreeDDA(*pConvNo);
    			return false;
    		}
    		return true;
    	}
    }
     
     
    // procedure for initializing DDEML.DLL
    bool DCInit()
    {
        UINT ui;
     
        // Set message string
    	csMsg = (CString)ccDMLERRInitialize;
     
    	// Initialize DDEML
        ui = DdeInitialize(&dwDDEInst,
                           (PFNCALLBACK) DdeCallback,
                           APPCMD_CLIENTONLY, 
                           0L);
     
    	// Initialize pointer arrays
    	for(int i = 0; i < wCONVMAX; i++)
    	{
    		DdeV[i] = NULL;
    		DDA[i] = NULL;
    	}
        if (ui != DMLERR_NO_ERROR)
    	{
    		DCGetLastError(dwDDEInst, (CString)ccDMLERRInitialize);
    		return false;
        }
    	else
    	{
    		return true;
    	}
    }
     
    // procedure which frees handles of the DDE conversation and memory associated
    // with the last transaction. Has has to be called after each transaction 
    // especially after transactions which give back data.
    // Important: After data handle is freed no pointer can access the data.
    // Therefore it has to be processed or copied to another buffer before.
    bool DCFreeDdeMem(WORD wC)
    {
    	bool bSuccess = true;
    	CString csMsgLocal = "";
     
    	csMsg = "";
     
    	// Free string handle now.
    	if (DdeV[wC]->hszItem != NULL) 
    	{
    		if(!DdeFreeStringHandle( dwDDEInst, DdeV[wC]->hszItem ))
    		{
    			csMsgLocal = (CString)ccMsgHandleErr01;
    			bSuccess = false;
    		}
    		DdeV[wC]->hszItem = NULL;
    	}
    	// Free data handle now
    	if(DdeV[wC]->hData)
    	{
    		if(!DdeFreeDataHandle(DdeV[wC]->hData))
    		{
    			csMsgLocal = csMsgLocal + (CString)" " + (CString)ccMsgHandleErr02;
    			bSuccess = false;
    		}
    		DdeV[wC]->hData = 0L;
    	}
    	// Free memory of dde data buffers
    	FreeData(wC);
     
    	if (!bSuccess) csMsg = csMsgLocal;
     
    	return bSuccess;
    }
     
    // procedure which disconnects a DDE connection
    bool DCDisconnect(WORD wC)
    {
    	int nSuccess = 1;
    	CString csMsgLocal = "";
     
    	csMsg = "";
     
    	// Free handles and memory associated with the  last transaction
    	if(!DCFreeDdeMem(wC)) csMsgLocal = csMsg;
     
        // Done with the conversation now.
     
    	nSuccess = DdeDisconnect(DdeV[wC]->hConv);
     
    	// Free memory for DDE variables
    	FreeDdeV(wC);
    	// Free memory for DDE data access variables
    	FreeDDA(wC);
     
    	if (nSuccess == 0)
    	{
    		DCGetLastError(dwDDEInst, csMsgLocal + (CString) " " + 
    								  (CString)szMsgDMLERRDisconnect);
    		return false;
    	}
    	return true;
    }
     
    // procedure which uninitializes DDEML.DLL
    bool DCUninit()
    {
    	if(DdeUninitialize(dwDDEInst))// && AfxFreeLibrary(dwDDEInst))
    	{
    		// Reset instance handle
    		dwDDEInst = 0;
    		return true;
    	}
        else
    	{
    		DCGetLastError(dwDDEInst, (CString)szMsgDMLERRUninitialize);
    		return false;
    	}
    }
     
     
    // handle DDE data
    bool DdeDataHandling(WORD wC, HDDEDATA hData, char szAccess[])
    {
    	bool bSuccess = false;
    	if (0 == strnicmp (szAccess,"string",6))
    	{
    		// get pointer to the data as string //in pszDCDataString
    		bSuccess = DdeDataString(wC, hData);
    	}
    	else if (0 == strnicmp (szAccess,"byte",4))
    		// fill c-structure with data for dde data access
    		bSuccess = DdeDataBytes(wC, hData);
     
    	return bSuccess;
    }
     
    // Do a DDE Transaction
    bool DCTransaction(WORD wC, char szType[], char szItem[], char szData[], 
    				   char szFormat[], DWORD dwTimeout, char szAccess[])
    {
    	bool bSuccess = true;
    	csMsg = "";
     
    	// Set parameters for dde transaction
    	SetDDEParams(wC, szType, szItem, szData, szFormat, &dwTimeout);
     
        // execute dde transaction
    	DdeV[wC]->hData = DdeClientTransaction(DdeV[wC]->pData, 
    											DdeV[wC]->cbData, 
    											DdeV[wC]->hConv, 
    											DdeV[wC]->hszItem, 
    											DdeV[wC]->wFmt,
    											DdeV[wC]->wType, 
    											DdeV[wC]->dwTimeout, 
    											&(DdeV[wC]->dwResult));
    	// store transaction ID
    	DDA[wC]->dwTransID = DdeV[wC]->dwResult;
    	// Error handling
    	if (DdeV[wC]->hData == 0)
    	{
    		// Transaction failed
    		csMsg = (CString)"'" + szType + (CString)" " + szItem + (CString)"' " + 
    				(CString)ccMsgTransactionFailed;
    		bSuccess = false;
    	}
    	// data handling for synchronous transactions
    	else if ((DdeV[wC]->wType == XTYP_REQUEST) && 
    		(DdeV[wC]->dwTimeout != TIMEOUT_ASYNC))
    	{
    		bSuccess = DdeDataHandling(wC, DdeV[wC]->hData, szAccess);
    		if (!bSuccess) 
    		{
    			FreeData(wC);
    			csMsg = (CString)ccMsgRequestFailed + szItem;
    		}
    	}
    	// store variable for data access format for asynchronous transaction
    	else if (DdeV[wC]->dwTimeout == TIMEOUT_ASYNC)
    		strncpy(DDA[wC]->szAccType,szAccess,sizeof(DDA[wC]->szAccType));
     
    	return bSuccess;
    }
     
     
    // procedure which gives back the message of last error.
    // By bDCErrorExport is decided whether the message is the return value of
    // the function or displayed in a message box.
    // The length of the message is is determined by the size of szErrorMsg.
    // If the message is longer than sizeof(szErrorMsg) it will be cut off,
    // and a comment is given.
    char* DCLastError()
    {
    	if(bDCErrorExport)
    	{
    		return (char*)csMsg.GetBuffer(0);
    	}
    	else
    	{
    		//MessageBox((HWND)GetActiveWindow(), csMsg, ccMsgCaption, MB_OK | MB_ICONERROR);
    		return 0;
    	}
    }
     
    // procedure which frees memory of DDE data
    void FreeData(WORD wC)
    {
    	// Free memory of dde data 
    	if(DDA[wC] != NULL)
    	{
    		if(DDA[wC]->pszData != NULL)
    		{
    			free(DDA[wC]->pszData);
    			DDA[wC]->pszData = NULL;
    		}
    		if(DDA[wC]->pData != NULL)
    		{
    			free(DDA[wC]->pData);
    			DDA[wC]->pData = NULL;
    		}
    	}
    }
     
    // procedure which frees memory, to be called before ending dll access.
    void DCFinalize()
    {
    	for (WORD i = 0; i < wCONVMAX; i++)
    	{
    		FreeData(i);
    		FreeDdeV(i);
    		FreeDDA(i);
    	}
    	_heapmin();
    }
     
     
    // helper procedure for DCAsynchTransactionCompleted which determines 
    // if a certain asynchronous transaction  has completed. 
    bool AsynchTransactionCompleted(WORD wC, DWORD dwTransID)
    {
    	MSG msg;
    	bool bSuccess = true;
     
    	csMsg = "";
     
    	if(dwTransID == DDA[wC]->dwCbTransID)
    	{
    		// Transaction IDs are equal, the desired transaction 
    		// was already handled by the callback function
    		DDA[wC]->dwCbTransID = 0;
    		bSuccess = bCbSuccess;
    		//char szTemp[100];
    		//sprintf(szTemp,"Entry TransID = CbTransID bSuccess: %i",bSuccess);
    		////MessageBox((HWND)GetActiveWindow(), szTemp, "AsynchTransactionCompleted", MB_OK);
    	}
    	else
    	{
    		// look for message in message queue
    		if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) == 0)
    		{
    			// no message in queue
    			csMsg = (CString)ccMsgNoWindowsMessage;
    			bSuccess = false;
    		}
    		else
    		{
     
    			//char szTemp[100];
    			//sprintf(szTemp,"Before dispatch Message: %i  TransID = %i  CbTransID = %i",msg.message,dwTransID,DDA[wC]->dwCbTransID);
    			////MessageBox((HWND)GetActiveWindow(), szTemp, "AsynchTransactionCompleted", MB_OK);
     
    			TranslateMessage(&msg); 
    			DispatchMessage(&msg); 
    			// a message was in the queue, is dispatched 
    			// and may have invoked the callback function
     
    			//sprintf(szTemp,"After dispatch TransID = %i  CbTransID = %i",dwTransID,DDA[wC]->dwCbTransID);
    			////MessageBox((HWND)GetActiveWindow(), szTemp, "AsynchTransactionCompleted", MB_OK);
     
    			if(dwTransID == DDA[wC]->dwCbTransID)
    			{
    				// Transaction IDs are equal, the desired transaction was handled 
    				// by the callback function
     
    				//sprintf(szTemp,"TransID = CbTransID Message: %i",msg.message);
    				////MessageBox((HWND)GetActiveWindow(), szTemp, "AsynchTransactionCompleted", MB_OK);
     
    				DDA[wC]->dwCbTransID = 0;
    				switch (msg.message) 
    				{
    					case 996: // = WM_DDE_ACK
    						if((DdeV[wC]->wType == XTYP_EXECUTE) |
    						(DdeV[wC]->wType == XTYP_POKE))
    							// execute and poke return only an ACK					
    							bSuccess = bCbSuccess;
    						if(DdeV[wC]->wType == XTYP_REQUEST)
    						{
    							// when command cannot be processes (applies not to all servers)
    							csMsg = (CString)ccMsgAsynchRequestNotCompleted;
    							bSuccess = false;
    						}
    						break;
     
    					case 997: // = WM_DDE_DATA
    						if(DdeV[wC]->wType == XTYP_REQUEST)
    						{
    							// request return data when finished
    							bSuccess = bCbSuccess;
     
    							//sprintf(szTemp,"inside WM_DDE_DATA bSuccess: %i",bSuccess);
    							////MessageBox((HWND)GetActiveWindow(), szTemp, "AsynchTransactionCompleted", MB_OK);
    						}
    						break;
     
    					default:
    						//char szTemp[100];
    						//sprintf(szTemp,"inside default branch");
    						////MessageBox((HWND)GetActiveWindow(), szTemp, "AsynchTransactionCompleted", MB_OK);
    						csMsg = (CString)ccMsgAsynchTransNotCompleted;
    						bSuccess = false;
    					}
    			}
    			else
    			{
    				csMsg = (CString)ccMsgAsynchTransNotCompleted;
    				bSuccess = false;
    			}
     
    		}
    	}
     
    	//char szTemp[100];
    	//sprintf(szTemp,"Before exit bSuccess: %i",bSuccess);
    	////MessageBox((HWND)GetActiveWindow(), szTemp, "AsynchTransactionCompleted", MB_OK);
    	return bSuccess;
    }
     
    // procedure which determines if a certain asynchronous transaction
    // has completed. Only to use for one transaction at a time, because
    // messages from other transactions will be ignored. Procedure enables
    // quasi synchronous behavior for asynchronous request, if called
    // after transaction call. To use if in between a transaction is processed
    // by a server some other calculations shall be done in the program without
    // waiting for the server to finish the transaction. After the calculations
    // this procedure can be called. If the server has finished it returns true,
    // if not false. 
    // bWait:	controls, if the procedure shall wait until the transaction is
    //			finished (true) or only check once for completion (false).
    bool DCAsynchTransactionCompleted(WORD wC, DWORD dwTransID, bool bWait)
    {
    	bool bSuccess;
    	do
    	{
    		bSuccess = AsynchTransactionCompleted(wC, dwTransID);
    		// transaction completed with error
    		if(!bCbSuccess) return false;
    		// transaction completed successful
    		else if(bSuccess && bCbSuccess) return true;
    		// 
    	}while(bWait && !bSuccess && bCbSuccess);
    	// no message available
    	return false;
    }
     
     
    // procedure which retrives the conversation number from a given
    // conversation handle
    WORD FindConvNo(HCONV hConv)
    {
    	for(WORD i = 0; i < wCONVMAX; i++)
    		if(DdeV[i]->hConv == hConv)
    			return i;
    	return wCONVMAX + 1;
    }
    // procedure which determines the next conversation number
    bool GetConvNo(WORD* pConvNo)
    {
    	WORD i = 0;
    	while((i < wCONVMAX) && (DdeV[i] != NULL)) i++;
    	if (i >= wCONVMAX)
    	{
    		// too many conversations
    		csMsg = (CString)ccMsgConvMaxError;
    		return false;
    	}
    	else
    	{
    		*pConvNo = i;
    		return true;
    	}
    }
     
    // Free memory for DDE variables
    void FreeDdeV(WORD wC)
    {
    	if(DdeV[wC] != NULL)
    	{
    		free(DdeV[wC]);
    		DdeV[wC] = NULL;
    	}
    	return;
    }
    // Free memory for DDE data access variables
    void FreeDDA(WORD wC)
    {
    	if(DDA[wC] != NULL)
    	{
    		free(DDA[wC]);
    		DDA[wC] = NULL;
    	}
    	return;
    }
     
    // procedure to abandon an asynchronous transaction
    // takes the conversation number and the transaction id
    bool DCAbandonTransaction(WORD wC, DWORD dwTransID)
    {
    	bool bSuccess;
     
    	bSuccess = DdeAbandonTransaction(dwDDEInst, DdeV[wC]->hConv, dwTransID);
    	FreeData(wC);
     
    	if(!bSuccess)
    	{
    		DCGetLastError(dwDDEInst, (CString)ccMsgAbandonTransaction);
    		bSuccess = false;
        }
    	else
    	{
    		bSuccess = true;
    	}
    	return bSuccess;
    }
     
    // procedure which gives back the version of this dll
    char* DCVersion()
    {
    	return szVersion;
    }
    Je ne comprend pas d’où vient ces erreurs. Quand je ne spécifie pas dans le .pro la librairie associé à cette dll, j'obtiens un grand nombre d'erreur du même type et quand je le fais, seul celle relative au pointeur DCDA persiste. Pourquoi celle la mais pas les autres?!?

    J'ai vraiment besoin d'un coup de main pour ce problème. J'espere que vous pourrez m'aider. C'est très très embêtant..

    Merci d'avance!

    MrBlod

  2. #2
    Inactif  


    Homme Profil pro
    Inscrit en
    Novembre 2008
    Messages
    5 288
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Secteur : Santé

    Informations forums :
    Inscription : Novembre 2008
    Messages : 5 288
    Points : 15 620
    Points
    15 620
    Par défaut
    Bonjour et bienvenu sur le forum

    Un lien vers la doc : http://qt.developpez.com/doc/latest/...ther-libraries

    Il faut en fait ajouter ton include et ton fichier dll :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    INCLUDEPATH = c:/chemin/vers/le/repertoire/contenant/les/include
    LIBS += -L/usr/local/lib -lDDEClient
    attention : -l (L minuscule) = nom du fichier dll ; -L (L majuscule) = répertoire contenant le fichier dll
    INCLUDEPATH = chemin vers le répertoire contenant les fichier DDEClient.h et DDE_IF.h

    Bon courage

    EDIT : en complément, si tu utilises QtCreator, tu peux ajouter une lib de la manière suivante :
    - ouvre le .pro
    - dans l'éditeur, clique droit -> Ajouter une bibliothèque...
    - remplir le formulaire
    C'est français donc je pense que ça en posera pas de problème
    source

  3. #3
    Nouveau Candidat au Club
    Inscrit en
    Mai 2011
    Messages
    4
    Détails du profil
    Informations forums :
    Inscription : Mai 2011
    Messages : 4
    Points : 1
    Points
    1
    Par défaut
    Merci pour ta réponse rapide!

    Je ne pense pas que le problème vienne du .pro..

    En réalité, j'utilise le modeler UML IBM Rationnal Rhapsody pour développer la partie "comportemental" de mon programme. J'utilise Qt pour la partie graphique.

    Sous Rhapsody, j'inclue la dll DDEClient.dll et sa librairie. Je compile mon projet sous forme de librairie avec le compilateur MinGw et j'obtiens un fichier QTLibComponent.a.

    Sous Qt maintenant, dans le .pro j'inclue cette librairie:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    LIBS += \
        C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a
    J'indique également le lien vers les fichiers .cpp, .h et .o créés pendant la compilation du projet sous Rhapsody:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    INCLUDEPATH += \
        C:/NOM_DU_PROJET/QTLibComponent/MinGW/
    Il ne me reste donc plus normalement qu'a spécifié mon fichier DDEClient.lib pour l’édition des liens sous QT, ce que je fais:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    win32:LIBS += \
        C:/Maquettes/Rhapsody-QT/"Rhp-QT Maquette_61850_v1.3"/Maquette_61850_v1.3/Extern/DDEClient.lib \
    Je précise que j'utilise plusieurs dll externes différentes sous Rhapsody, pas uniquement DDEClient.dll et cette façon de procéder fonctionne parfaitement avec les autres.
    Seul cette dernière pose problème, je pense donc que c'est lié à son contenue et à Qt.. C'est pourquoi j'ai posté dans mon premier poste le code de DDEClient.h..

    J’espère avoir été clair. Merci d'avance pour votre aide!

    MrBlod.

    PS: j'ai le code source de DDEClient.dll... Une solution ne peut-elle pas être de tout re compiler la dll avec MinGw pour obtenir un .a? Peu être n'y aura t'il plus de problème de lien?? Si oui, comment faire?

    J'ai créé un nouveau projet DDEClient de type Autre projet/Bibliothèque C++. J'avais au départ deux fichiers:
    DDEClient.cpp et DDEClient.h. J'ai copier/coller le contenu des fichiers DDEClient.cpp et DDEClient.h du projet sous visual studio dans ces derniers. Puis j'ai ajouté dans le .pro INCLUDEPATH parce qu'il avait besoin de certain .h notamment atlstr.h et d'autres..
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    INCLUDEPATH += C:/"Program Files"/"Microsoft Visual Studio 8"/VC/include/ \
        C:/"Program Files"/"Microsoft Visual Studio 8"/VC/atlmfc/include/
    Mais j’obtiens beaucoup beaucoup de warning et toujours des erreurs à la compilation..

    Par exemple:

    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
     
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include/atlalloc.h:80:30: error: invalid suffix "i64" on integer constant
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include/atlalloc.h:81:30: error: invalid suffix "i64" on integer constant
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include/atlalloc.h:89:39: error: invalid suffix "ui64" on integer constant
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/crtdefs.h:521: error: '__int64' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/crtdefs.h:530: error: '__time64_t' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include/atldef.h:55: error: 'Inconsistent_definition_of_symbol__ATL_MIXED::clash':'selectany' attribute applies only to initialized objects
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:116: error: '__time64_t' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:117: error: '__time64_t' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:118: error: '__time64_t' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:125: error: '__time64_t' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:126: error: '__time64_t' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:127: error: '__time64_t' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:549: error: '__time64_t' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:550: error: '__time64_t' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:551: error: '__time64_t' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:563: error: '__time64_t' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:564: error: '__time64_t' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:565: error: '__time64_t' does not name a type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:625: error: declaration of 'size_t* _Size'
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:625: error:  shadows template parm 'unsigned int _Size'
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h: In function 'errno_t _cgetws_s(wchar_t (&)[_Size], size_t*)':
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:625: error: declaration of 'size_t* _Size'
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:625: error:  shadows template parm 'unsigned int _Size'
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h: At global scope:
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:708: error: expected constructor, destructor, or type conversion before '(' token
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:708: error: expected constructor, destructor, or type conversion before '(' token
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:708: error: expected constructor, destructor, or type conversion before '(' token
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:716: error: expected constructor, destructor, or type conversion before '(' token
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:716: error: expected constructor, destructor, or type conversion before '(' token
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:716: error: expected constructor, destructor, or type conversion before '(' token..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:1145: error: ISO C++ forbids declaration of '__time64_t' with no type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:1145: error: expected ',' or '...' before '*' token
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:1146: error: ISO C++ forbids declaration of '__time64_t' with no type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:1146: error: expected ',' or '...' before '*' token
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:1147: error: ISO C++ forbids declaration of '__time64_t' with no type
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:1147: error: expected ',' or '...' before '*' token
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h: In function 'errno_t _wctime64_s(wchar_t (&)[_Size], int)':
    ..\..\..\Program Files\Microsoft Visual Studio 8\VC\include/wchar.h:1147: error: '_Time' was not declared in this scope
    ETC................

  4. #4
    Inactif  


    Homme Profil pro
    Inscrit en
    Novembre 2008
    Messages
    5 288
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Secteur : Santé

    Informations forums :
    Inscription : Novembre 2008
    Messages : 5 288
    Points : 15 620
    Points
    15 620
    Par défaut
    Citation Envoyé par Mrblod Voir le message
    Merci pour ta réponse rapide!

    Je ne pense pas que le problème vienne du .pro..

    En réalité, j'utilise le modeler UML IBM Rationnal Rhapsody pour développer la partie "comportemental" de mon programme. J'utilise Qt pour la partie graphique.

    Sous Rhapsody, j'inclue la dll DDEClient.dll et sa librairie. Je compile mon projet sous forme de librairie avec le compilateur MinGw et j'obtiens un fichier QTLibComponent.a.

    Sous Qt maintenant, dans le .pro j'inclue cette librairie:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    LIBS += \
        C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a
    Relis ce que j'ai écris. Il faut écrire :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    LIBS += \
        -lC:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a
    Citation Envoyé par Mrblod Voir le message
    J'indique également le lien vers les fichiers .cpp, .h et .o créés pendant la compilation du projet sous Rhapsody:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    INCLUDEPATH += \
        C:/NOM_DU_PROJET/QTLibComponent/MinGW/
    Non, INCLUDEPATH indique les répertoires dans lesquels mingw recherche les fichiers d'en-tête (.h), pas les fichiers .cpp et .o

    Citation Envoyé par Mrblod Voir le message
    Il ne me reste donc plus normalement qu'a spécifié mon fichier DDEClient.lib pour l’édition des liens sous QT, ce que je fais:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    win32:LIBS += \
        C:/Maquettes/Rhapsody-QT/"Rhp-QT Maquette_61850_v1.3"/Maquette_61850_v1.3/Extern/DDEClient.lib \
    Idem que précédemment

    Citation Envoyé par Mrblod Voir le message
    Je précise que j'utilise plusieurs dll externes différentes sous Rhapsody, pas uniquement DDEClient.dll et cette façon de procéder fonctionne parfaitement avec les autres.
    Seul cette dernière pose problème, je pense donc que c'est lié à son contenue et à Qt.. C'est pourquoi j'ai posté dans mon premier poste le code de DDEClient.h..
    Je ne comprend pas très bien les étapes suivies. Tu crées quoi sous Rhapsody et tu compiles quoi avec mingw/Qt ?
    C'est quoi DDEClient ?

    Citation Envoyé par Mrblod Voir le message
    J’espère avoir été clair. Merci d'avance pour votre aide!

    MrBlod.

    PS: j'ai le code source de DDEClient.dll... Une solution ne peut-elle pas être de tout re compiler la dll avec MinGw pour obtenir un .a? Peu être n'y aura t'il plus de problème de lien??
    Pas besoin, tu peux linker sans problème un .dll dans un projet c++ (en ayant le .h)

  5. #5
    Nouveau Candidat au Club
    Inscrit en
    Mai 2011
    Messages
    4
    Détails du profil
    Informations forums :
    Inscription : Mai 2011
    Messages : 4
    Points : 1
    Points
    1
    Par défaut
    Voila très exactement ce qu'il y a dans mon .pro:

    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
    LIBS += \
        -lws2_32 \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwaomanim.a \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwomcomappl.a \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwoxfinst.a \
        C:/Maquettes/Rhapsody-QT/"Rhp-QT Maquette_61850_v1.3"/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwoxf.a \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwaomanim.a \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwomcomappl.a \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwoxfinst.a \
        -lws2_32
     
    win32:LIBS += \
        -lws2_32 \
        C:/Maquettes/Rhapsody-QT/"Rhp-QT Maquette_61850_v1.3"/Maquette_61850_v1.3/Extern/WTclient.lib \
        C:/Maquettes/Rhapsody-QT/"Rhp-QT Maquette_61850_v1.3"/Maquette_61850_v1.3/Extern/DDEClient.lib \
        C:/"Program Files"/"Microsoft Visual Studio"/VC98/Lib/OleAut32.lib \
        -lws2_32
     
    INCLUDEPATH += \
        C:/Maquettes/Rhapsody-QT/"Rhp-QT Maquette_61850_v1.3"/Maquette_61850_v1.3/QTLibComponent/MinGW/ \
        C:/Maquettes/Rhapsody-QT/"Rhp-QT Maquette_61850_v1.3"/Maquette_61850_v1.3/Extern/ \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/ \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/osconfig/MinGw/
    Je sais c'est bizarre, c'est pour ça que je ne voulais pas forcement vous embrouiller avec ça... Je respecte scrupuleusement la méthode pour pouvoir utiliser une librairie compilé sous Rhapsody dans Qt, j'ai rien inventé

    Je le répète, le problème ne vient pas du .pro... Par exemple pour la dll WTclient, qui spécifie un ensemble de fonction pour créer un client OPC, tout fonctionne correctement de cette manière...

    Pour la méthode:

    Sous Rhapsody je crée un projet ou je spécifie le "comportement" de mon programme en UML et j'y inclue les librairies externes dont j'ai besoin (DDEClient.dll et Wtclient.dll). Je génère le code en c++ à partir de l'UML et enfin je compile le tout sous forme de librairie avec le compilateur MinGw (j'obtiens un .a). Ensuite je crée un projet Qt dans lequel j'inclue cette librairie et je crée l'interface graphique du programme... Ca fonctionne très bien.. j'ai juste des problèmes au niveau de l'édition de lien sous Qt pour DDEClient.dll..

    Si je n'ajoute pas DDEClient.lib dans le .pro il ne peux pas faire l'édition de lien donc j'ai plein d'erreur => normal:

    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
    Exécution des étapes de compilation pour le projet NOM_DU_PROJET...
    Configuration inchangée, étape QMake sautée.
    Commence : "C:\QtSDK\mingw\bin\mingw32-make.exe" 
    C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory `C:/NOM_DU_PROJET/NOM_DU_PROJET-build-desktop'
    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\NOM_DU_PROJET.exe object_script.NOM_DU_PROJET.Debug  -L"c:\QtSDK\Desktop\Qt\4.7.3\mingw\lib" -lmingw32 -lqtmaind -lws2_32 "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwaomanim.a" "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwomcomappl.a" "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwoxfinst.a" "NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a" "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwoxf.a" "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwaomanim.a" "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwomcomappl.a" "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwoxfinst.a" -lws2_32 "NOM_DU_PROJET/Extern/WTclient.lib" "C:/Program Files/Microsoft Visual Studio/VC98/Lib/OleAut32.lib" -lQtGuid4 -lQtCored4 -LC:\OpenSSL-Win32_full\lib 
    mingw32-make[1]: Leaving directory `C:/NOM_DU_PROJET/NOM_DU_PROJET-build-desktop'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: Offset (4956) greater than or equal to (null) size (4954657).
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x337): undefined reference to `_imp__DCDisconnect'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x358): undefined reference to `_imp__DCUninit'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '20039', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x379): undefined reference to `_imp__DCFinalize'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '11075', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x47c): undefined reference to `_imp__DCInit'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '11828', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x4bd): undefined reference to `_imp__DCConnect'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '50', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x611): undefined reference to `_imp__DCRequestString'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '17732', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x633): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '11846', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x65f): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '112', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x68a): undefined reference to `_imp__DCFreeDdeMem'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '19804', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x92b): undefined reference to `_imp__DCTransaction'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '25973', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x94d): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '29541', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x975): undefined reference to `_imp__DCAsynchTransactionCompleted'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '24936', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0xafa): undefined reference to `_imp__DCTransaction'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '25711', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0xb1c): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '21585', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0xb44): undefined reference to `_imp__DCAsynchTransactionCompleted'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '28776', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0xce4): undefined reference to `_imp__DCTransaction'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '8276', this reader only handles version 2 and 3 information.
    C:/NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0xd06): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '30065', this reader only handles version 2 and 3 information.
    NOM_DU_PROJET/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0xd2e): undefined reference to `_imp__DCAsynchTransactionCompleted'
    collect2: ld returned 1 exit status
    mingw32-make[1]: *** [debug\NOM_DU_PROJET.exe] Error 1
    mingw32-make: *** [debug] Error 2
    Le processus "C:\QtSDK\mingw\bin\mingw32-make.exe" s'est terminé avec le code 2.
    Erreur à la compilation du projet NOM_DU_PROJET (cible : Desktop)
    Lors de l'exécution de l'étape 'Make'
    Si je l'ajoute, j'ai beaucoup moins d'erreurs cependant il me reste celle (et seulement celle) relative au pointeur DCDA dans le fichier DDEClient.h (voir premier post):

    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
    Exécution des étapes de compilation pour le projet NOM_DU_PROJET...
    Configuration inchangée, étape QMake sautée.
    Commence : "C:\QtSDK\mingw\bin\mingw32-make.exe" 
    C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory `C:/NOM_DU_PROJET-build-desktop'
    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\NOM_DU_PROJET.exe debug/main.o debug/p...ETC...
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: Offset (4448) greater than or equal to (null) size (4954657).
    C:/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x629): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
    C:/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x655): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '20039', this reader only handles version 2 and 3 information.
    C:/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x8ed): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '11075', this reader only handles version 2 and 3 information.
    C:/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0xabc): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '11828', this reader only handles version 2 and 3 information.
    C:/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0xca6): undefined reference to `_imp__DCDA'
    collect2: ld returned 1 exit status
    mingw32-make[1]: Leaving directory `C:/NOM_DU_PROJET-build-desktop'
    mingw32-make[1]: *** [debug\NOM_DU_PROJET.exe] Error 1
    mingw32-make: *** [debug] Error 2
    Le processus "C:\QtSDK\mingw\bin\mingw32-make.exe" s'est terminé avec le code 2.
    Erreur à la compilation du projet NOM_DU_PROJET (cible : Desktop)
    Lors de l'exécution de l'étape 'Make'

  6. #6
    Inactif  


    Homme Profil pro
    Inscrit en
    Novembre 2008
    Messages
    5 288
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Secteur : Santé

    Informations forums :
    Inscription : Novembre 2008
    Messages : 5 288
    Points : 15 620
    Points
    15 620
    Par défaut
    Je vais vérifier plus tard mais pour moi, il manque le -l devant chaque nom de lib (dans les LIBS +=)

    EDIT : je confirme, il faut bien le "-l"

  7. #7
    Nouveau Candidat au Club
    Inscrit en
    Mai 2011
    Messages
    4
    Détails du profil
    Informations forums :
    Inscription : Mai 2011
    Messages : 4
    Points : 1
    Points
    1
    Par défaut
    J'ai modifié le .pro ainsi:

    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
    LIBS += \
        -lws2_32 \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwaomanim.a \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwomcomappl.a \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwoxfinst.a \
        C:/Maquettes/Rhapsody-QT/"Rhp-QT Maquette_61850_v1.3"/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwoxf.a \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwaomanim.a \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwomcomappl.a \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwoxfinst.a \
        -lws2_32
     
    win32:LIBS += \
        -LC:/Maquettes/Rhapsody-QT/"Rhp-QT Maquette_61850_v1.3"/Maquette_61850_v1.3/Extern -lWTclient \
        -LC:/Maquettes/Rhapsody-QT/"Rhp-QT Maquette_61850_v1.3"/Maquette_61850_v1.3/Extern -lDDEClient \
        -LC:/"Program Files"/"Microsoft Visual Studio"/VC98/Lib -lOleAut32 \
    
    INCLUDEPATH += \
        C:/Maquettes/Rhapsody-QT/"Rhp-QT Maquette_61850_v1.3"/Maquette_61850_v1.3/QTLibComponent/MinGW/ \
        C:/Maquettes/Rhapsody-QT/"Rhp-QT Maquette_61850_v1.3"/Maquette_61850_v1.3/Extern/ \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/ \
        C:/"Program Files"/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/osconfig/MinGw/
    Cela a conserver les erreurs sur le pointeur DCDA mais il y en a d'autres en plus:

    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
    Exécution des étapes de compilation pour le projet NOM_DU_PROJET...
    Configuration inchangée, étape QMake sautée.
    Commence : "C:\QtSDK\mingw\bin\mingw32-make.exe" 
    C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory `C:/NOM_DU_PROJET_GUI-build-desktop'
    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\NOM_DU_PROJET.exe object_script.NOM_DU_PROJET.Debug  -L"c:\QtSDK\Desktop\Qt\4.7.3\mingw\lib" -lmingw32 -lqtmaind -lws2_32 "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwaomanim.a" "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwomcomappl.a" "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwoxfinst.a" "C:/Maquettes/Rhapsody-QT/Rhp-QT Maquette_61850_v1.3/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a" "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwoxf.a" "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwaomanim.a" "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwomcomappl.a" "C:/Program Files/IBM/Rational/Rhapsody/7.5.2/Share/LangCpp/Lib/mingwoxfinst.a" -lws2_32 "-LC:/Maquettes/Rhapsody-QT/Rhp-QT Maquette_61850_v1.3/Maquette_61850_v1.3/Extern" -lWTclient "-LC:/Maquettes/Rhapsody-QT/Rhp-QT Maquette_61850_v1.3/Maquette_61850_v1.3/Extern" -lDDEClient "-LC:/Program Files/Microsoft Visual Studio/VC98/Lib" -lOleAut32 -lQtGuid4 -lQtCored4 -LC:\OpenSSL-Win32_full\lib 
    mingw32-make[1]: Leaving directory `C:/Maquettes/Rhapsody-QT/Rhp-QT Maquette_61850_v1.3/NOM_DU_PROJET-build-desktop'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../crt2.o:crt1.c:(.text+0x1b3): undefined reference to `_imp___iob'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../crt2.o:crt1.c:(.text+0x1ce): undefined reference to `_imp___iob'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../crt2.o:crt1.c:(.text+0x1df): undefined reference to `_imp___iob'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../crt2.o:crt1.c:(.text+0x1f2): undefined reference to `_imp___iob'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../crt2.o:crt1.c:(.text+0x265): undefined reference to `_imp___iob'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../crt2.o:crt1.c:(.text+0x276): more undefined references to `_imp___iob' follow
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../crt2.o:crt1.c:(.text+0x2c3): undefined reference to `_imp__atexit'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../crt2.o:crt1.c:(.text+0x2d3): undefined reference to `_imp___onexit'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: Offset (4956) greater than or equal to (null) size (4954657).
    C:/Maquettes/Rhapsody-QT/Rhp-QT Maquette_61850_v1.3/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x633): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
    C:/Maquettes/Rhapsody-QT/Rhp-QT Maquette_61850_v1.3/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x65f): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '20039', this reader only handles version 2 and 3 information.
    C:/Maquettes/Rhapsody-QT/Rhp-QT Maquette_61850_v1.3/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0x94d): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '11075', this reader only handles version 2 and 3 information.
    C:/Maquettes/Rhapsody-QT/Rhp-QT Maquette_61850_v1.3/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0xb1c): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '11828', this reader only handles version 2 and 3 information.
    C:/Maquettes/Rhapsody-QT/Rhp-QT Maquette_61850_v1.3/Maquette_61850_v1.3/QTLibComponent/MinGW/QTLibComponent.a(DDE_IF.o):DDE_IF.cpp:(.text+0xd06): undefined reference to `_imp__DCDA'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/libstdc++.a(ios_init.o): In function `Init':
    C:\MinGW\src\gccbf\mingw32\libstdc++-v3\src/../../../../gcc-4.4.0/libstdc++-v3/src/ios_init.cc:85: undefined reference to `_imp___iob'
    C:\MinGW\src\gccbf\mingw32\libstdc++-v3\src/../../../../gcc-4.4.0/libstdc++-v3/src/ios_init.cc:85: undefined reference to `_imp___iob'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/libstdc++.a(ios_init.o):C:\MinGW\src\gccbf\mingw32\libstdc++-v3\src/../../../../gcc-4.4.0/libstdc++-v3/src/ios_init.cc:178: undefined reference to `_imp___iob'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/libstdc++.a(vterminate.o):C:\MinGW\src\gccbf\mingw32\libstdc++-v3\libsupc++/../../../../gcc-4.4.0/libstdc++-v3/libsupc++/vterminate.cc:47: undefined reference to `_imp___iob'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/libstdc++.a(vterminate.o):C:\MinGW\src\gccbf\mingw32\libstdc++-v3\libsupc++/../../../../gcc-4.4.0/libstdc++-v3/libsupc++/vterminate.cc:65: undefined reference to `_imp___iob'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/libstdc++.a(vterminate.o):C:\MinGW\src\gccbf\mingw32\libstdc++-v3\libsupc++/../../../../gcc-4.4.0/libstdc++-v3/libsupc++/vterminate.cc:91: more undefined references to `_imp___iob' follow
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/libstdc++.a(codecvt_members.o):C:\MinGW\src\gccbf\mingw32\libstdc++-v3\src/codecvt_members.cc:161: undefined reference to `_imp____mb_cur_max'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/libstdc++.a(codecvt_members.o):C:\MinGW\src\gccbf\mingw32\libstdc++-v3\src/codecvt_members.cc:173: undefined reference to `_imp____mb_cur_max'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/libstdc++.a(codecvt_members.o):C:\MinGW\src\gccbf\mingw32\libstdc++-v3\src/codecvt_members.cc:61: undefined reference to `_imp____mb_cur_max'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(wctob.o):wctob.c:(.text+0x15): undefined reference to `_imp____lc_codepage'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(btowc.o):btowc.c:(.text+0x16): undefined reference to `_imp____lc_codepage'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(mbrtowc.o):mbrtowc.c:(.text+0x1a5): undefined reference to `_imp____lc_codepage'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(mbrtowc.o):mbrtowc.c:(.text+0x1ac): undefined reference to `_imp____mb_cur_max'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(mbrtowc.o):mbrtowc.c:(.text+0x1e1): undefined reference to `_imp____lc_codepage'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(mbrtowc.o):mbrtowc.c:(.text+0x1ec): undefined reference to `_imp____mb_cur_max'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(mbrtowc.o):mbrtowc.c:(.text+0x254): undefined reference to `_imp____lc_codepage'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(mbrtowc.o):mbrtowc.c:(.text+0x261): undefined reference to `_imp____mb_cur_max'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(mbrtowc.o):mbrtowc.c:(.text+0x334): undefined reference to `_imp____lc_codepage'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(mbrtowc.o):mbrtowc.c:(.text+0x346): undefined reference to `_imp____mb_cur_max'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(wcrtomb.o):wcrtomb.c:(.text+0xa2): undefined reference to `_imp____lc_codepage'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(wcrtomb.o):wcrtomb.c:(.text+0xa9): undefined reference to `_imp____mb_cur_max'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(wcrtomb.o):wcrtomb.c:(.text+0xc5): undefined reference to `_imp____lc_codepage'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(wcrtomb.o):wcrtomb.c:(.text+0xd0): undefined reference to `_imp____mb_cur_max'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(wcrtomb.o):wcrtomb.c:(.text+0xf4): undefined reference to `_imp____lc_codepage'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(wcrtomb.o):wcrtomb.c:(.text+0x119): undefined reference to `_imp____mb_cur_max'
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingwex.a(pformat.o):pformat.c:(.text+0x166d): undefined reference to `_get_output_format'
    collect2: ld returned 1 exit status
    mingw32-make[1]: *** [debug\NOM_DU_PROJET.exe] Error 1
    mingw32-make: *** [debug] Error 2
    Le processus "C:\QtSDK\mingw\bin\mingw32-make.exe" s'est terminé avec le code 2.
    Erreur à la compilation du projet NOM_DU_PROJET (cible : Desktop)
    Lors de l'exécution de l'étape 'Make'
    EDIT: J'ai rajouté le fichier DDEClient.cpp à mon premier poste..
    J'ai modifié dans le .cpp et le .h _declspec par __declspec.
    L'attribue char szAccType[] de la structure DCDATAACCESS était définie de taille 6 dans le .cpp et de taille 7 dans le .h, j'ai donc mis à 6 sa taille dans le .h...
    J'ai re compilé la dll mais le même problème survient toujours avec DCDA..

    Je ne comprends vraiment pas..

Discussions similaires

  1. Réponses: 1
    Dernier message: 31/12/2007, 01h59
  2. Réponses: 3
    Dernier message: 04/07/2007, 14h08
  3. Problème à l'édition des liens
    Par Frederick_Etudiant dans le forum Code::Blocks
    Réponses: 3
    Dernier message: 03/05/2007, 17h01
  4. [Dev-C++] Problème d'édition des liens
    Par shura dans le forum EDI
    Réponses: 5
    Dernier message: 30/08/2005, 09h35
  5. Problème à l'édition des liens avec BCC55 et Xerces
    Par ShootDX dans le forum Autres éditeurs
    Réponses: 4
    Dernier message: 30/11/2003, 14h50

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