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

C++ Discussion :

[Visual C++] Mélanger du C avec du C++ et enrober le tout de sauce windows


Sujet :

C++

  1. #1
    Membre confirmé
    Inscrit en
    Septembre 2006
    Messages
    110
    Détails du profil
    Informations forums :
    Inscription : Septembre 2006
    Messages : 110
    Par défaut [Visual C++] Mélanger du C avec du C++ et enrober le tout de sauce windows
    Bonjour,

    Je suis en train de faire une DLL multithreaded sous Visual C++ 6. Je dispose d'un squelette en C++ pour la génération de cette DLL avec les méthodes à implémenter. Les méthodes à implémenter font appel à du code pur C.
    Alors je fais la soupe avec C et C++, et le linkage est un vrai calvert ! J'ai plein d'erreur d'importation, j'ai mis du
    [cpp]
    #ifdef __cplusplus
    extern "C" {
    #endif
    //mes includes
    #ifdef __cplusplus
    }
    #endif[/cpp]

    un peu partout, rien marche et ça change jamais rien.

    [fixed]--------------------Configuration: TiersdeConfiance - Win32 Release--------------------
    Compiling...
    Constant.cpp
    Log.cpp
    Session.cpp
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(28) : warning C4273: 'fread' : inconsistent dll linkage. dllexport assumed.
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(29) : warning C4273: 'fwrite' : inconsistent dll linkage. dllexport assumed.
    tedetisEnvelop.cpp
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(28) : warning C4273: 'fread' : inconsistent dll linkage. dllexport assumed.
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(29) : warning C4273: 'fwrite' : inconsistent dll linkage. dllexport assumed.
    tedetisSession.cpp
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(28) : warning C4273: 'fread' : inconsistent dll linkage. dllexport assumed.
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(29) : warning C4273: 'fwrite' : inconsistent dll linkage. dllexport assumed.
    TiersdeConfianceAuto.cpp
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(28) : warning C4273: 'fread' : inconsistent dll linkage. dllexport assumed.
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(29) : warning C4273: 'fwrite' : inconsistent dll linkage. dllexport assumed.
    Generating Code...
    Linking...
    Creating library Release/TiersdeConfiance.lib and object Release/TiersdeConfiance.exp
    Constant.obj : error LNK2001: unresolved external symbol __imp__fclose
    Log.obj : error LNK2001: unresolved external symbol __imp__fclose
    tedetisSession.obj : error LNK2001: unresolved external symbol __imp__fclose
    Constant.obj : error LNK2001: unresolved external symbol __imp__fgets
    Constant.obj : error LNK2001: unresolved external symbol __imp__fopen
    Log.obj : error LNK2001: unresolved external symbol __imp__fopen
    tedetisSession.obj : error LNK2001: unresolved external symbol __imp__fopen
    Constant.obj : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
    Log.obj : error LNK2001: unresolved external symbol __imp__fprintf
    tedetisSession.obj : error LNK2001: unresolved external symbol __imp__fprintf
    Log.obj : error LNK2001: unresolved external symbol __imp__ctime
    Log.obj : error LNK2001: unresolved external symbol __imp___ftime
    Session.obj : error LNK2001: unresolved external symbol __imp__free
    tedetisEnvelop.obj : error LNK2001: unresolved external symbol __imp__free
    tedetisSession.obj : error LNK2001: unresolved external symbol __imp__free
    Session.obj : error LNK2001: unresolved external symbol __imp__malloc
    tedetisEnvelop.obj : error LNK2001: unresolved external symbol __imp__malloc
    tedetisSession.obj : error LNK2001: unresolved external symbol __imp__malloc
    Session.obj : error LNK2001: unresolved external symbol __imp___itoa
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol __imp___itoa
    Session.obj : error LNK2001: unresolved external symbol __imp__calloc
    Session.obj : error LNK2001: unresolved external symbol __imp__atoi
    tedetisEnvelop.obj : error LNK2001: unresolved external symbol __imp__atoi
    tedetisEnvelop.obj : error LNK2001: unresolved external symbol __imp__stat
    OLDNAMES.lib(stat.obi) : error LNK2001: unresolved external symbol __imp__stat
    tedetisEnvelop.obj : error LNK2001: unresolved external symbol __imp__strtok
    tedetisEnvelop.obj : error LNK2001: unresolved external symbol __imp__sprintf
    tedetisSession.obj : error LNK2001: unresolved external symbol __imp___iob
    tedetisSession.obj : error LNK2001: unresolved external symbol __chkstk
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: static struct AFX_MSGMAP const CWinApp::messageMap" (__imp_?messageMap@CWinApp@@1UAFX_MSGMAP@@B)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CWinApp::WinHelpA(unsigned long,unsigned int)" (?WinHelpA@CWinApp@@UAEXKI@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinApp::OnDDECommand(char *)" (?OnDDECommand@CWinApp@@UAEHPAD@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CWinApp:oWaitCursor(int)" (?DoWaitCursor@CWinApp@@UAEXH@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinApp:oMessageBox(char const *,unsigned int,unsigned int)" (?DoMessageBox@CWinApp@@UAEHPBDII@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinApp::SaveAllModified(void)" (?SaveAllModified@CWinApp@@UAEHXZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinApp::InitApplication(void)" (?InitApplication@CWinApp@@UAEHXZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CWinApp::AddToRecentFileList(char const *)" (?AddToRecentFileList@CWinApp@@UAEXPBD@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual class CDocument * __thiscall CWinApp::OpenDocumentFile(char const *)" (?OpenDocumentFile@CWinApp@@UAEPAVCDocument@@PBD@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CWinThread:elete(void)" (?Delete@CWinThread@@UAEXXZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual class CWnd * __thiscall CWinThread::GetMainWnd(void)" (?GetMainWnd@CWinThread@@UAEPAVCWnd@@XZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinThread:rocessMessageFilter(int,struct tagMSG *)" (?ProcessMessageFilter@CWinThread@@UAEHHPAUtagMSG@@@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall CWinApp:rocessWndProcException(class CException *,struct tagMSG const *)" (?ProcessWndProcException@CWinApp@@UAEJPAVCException@@PBUtagMSG@@@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinApp::ExitInstance(void)" (?ExitInstance@CWinApp@@UAEHXZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinThread::IsIdleMessage(struct tagMSG *)" (?IsIdleMessage@CWinThread@@UAEHPAUtagMSG@@@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinApp::OnIdle(long)" (?OnIdle@CWinApp@@UAEHJ@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinThread:umpMessage(void)" (?PumpMessage@CWinThread@@UAEHXZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinThread:reTranslateMessage(struct tagMSG *)" (?PreTranslateMessage@CWinThread@@UAEHPAUtagMSG@@@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinApp::Run(void)" (?Run@CWinApp@@UAEHXZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "protected: virtual struct IConnectionPoint * __thiscall CCmdTarget::GetConnectionHook(struct _GUID const &)" (?GetConnectionHook@CCmdTarget@@MAEPAUIConnectionPoint@@ABU_GUID@@@Z)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "protected: virtual struct IConnectionPoint * __thiscall CCmdTarget::GetConnectionHook(struct _GUID const &)" (?GetConnectionHook@CCmdTarget@@MAEPAUIConnectionPoint@@ABU_GUID@@@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "protected: virtual int __thiscall CCmdTarget::GetExtraConnectionPoints(class CPtrArray *)" (?GetExtraConnectionPoints@CCmdTarget@@MAEHPAVCPtrArray@@@Z)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "protected: virtual int __thiscall CCmdTarget::GetExtraConnectionPoints(class CPtrArray *)" (?GetExtraConnectionPoints@CCmdTarget@@MAEHPAVCPtrArray@@@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual struct IUnknown * __thiscall CCmdTarget::GetInterfaceHook(void const *)" (?GetInterfaceHook@CCmdTarget@@UAEPAUIUnknown@@PBX@Z)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: virtual struct IUnknown * __thiscall CCmdTarget::GetInterfaceHook(void const *)" (?GetInterfaceHook@CCmdTarget@@UAEPAUIUnknown@@PBX@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CCmdTarget::OnCreateAggregates(void)" (?OnCreateAggregates@CCmdTarget@@UAEHXZ)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CCmdTarget::OnCreateAggregates(void)" (?OnCreateAggregates@CCmdTarget@@UAEHXZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_EVENTSINKMAP const * __thiscall CCmdTarget::GetEventSinkMap(void)const " (?GetEventSinkMap@CCmdTarget@@MBEPBUAFX_EVENTSINKMAP@@XZ)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_EVENTSINKMAP const * __thiscall CCmdTarget::GetEventSinkMap(void)const " (?GetEventSinkMap@CCmdTarget@@MBEPBUAFX_EVENTSINKMAP@@XZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_INTERFACEMAP const * __thiscall CCmdTarget::GetInterfaceMap(void)const " (?GetInterfaceMap@CCmdTarget@@MBEPBUAFX_INTERFACEMAP@@XZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_CONNECTIONMAP const * __thiscall CCmdTarget::GetConnectionMap(void)const " (?GetConnectionMap@CCmdTarget@@MBEPBUAFX_CONNECTIONMAP@@XZ)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_CONNECTIONMAP const * __thiscall CCmdTarget::GetConnectionMap(void)const " (?GetConnectionMap@CCmdTarget@@MBEPBUAFX_CONNECTIONMAP@@XZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_DISPMAP const * __thiscall CCmdTarget::GetDispatchMap(void)const " (?GetDispatchMap@CCmdTarget@@MBEPBUAFX_DISPMAP@@XZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_OLECMDMAP const * __thiscall CCmdTarget::GetCommandMap(void)const " (?GetCommandMap@CCmdTarget@@MBEPBUAFX_OLECMDMAP@@XZ)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_OLECMDMAP const * __thiscall CCmdTarget::GetCommandMap(void)const " (?GetCommandMap@CCmdTarget@@MBEPBUAFX_OLECMDMAP@@XZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall CCmdTarget::GetTypeLib(unsigned long,struct ITypeLib * *)" (?GetTypeLib@CCmdTarget@@UAEJKPAPAUITypeLib@@@Z)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall CCmdTarget::GetTypeLib(unsigned long,struct ITypeLib * *)" (?GetTypeLib@CCmdTarget@@UAEJKPAPAUITypeLib@@@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual class CTypeLibCache * __thiscall CCmdTarget::GetTypeLibCache(void)" (?GetTypeLibCache@CCmdTarget@@UAEPAVCTypeLibCache@@XZ)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: virtual class CTypeLibCache * __thiscall CCmdTarget::GetTypeLibCache(void)" (?GetTypeLibCache@CCmdTarget@@UAEPAVCTypeLibCache@@XZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall CCmdTarget::GetTypeInfoCount(void)" (?GetTypeInfoCount@CCmdTarget@@UAEIXZ)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall CCmdTarget::GetTypeInfoCount(void)" (?GetTypeInfoCount@CCmdTarget@@UAEIXZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CCmdTarget::GetDispatchIID(struct _GUID *)" (?GetDispatchIID@CCmdTarget@@UAEHPAU_GUID@@@Z)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CCmdTarget::GetDispatchIID(struct _GUID *)" (?GetDispatchIID@CCmdTarget@@UAEHPAU_GUID@@@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CCmdTarget::IsInvokeAllowed(long)" (?IsInvokeAllowed@CCmdTarget@@UAEHJ@Z)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CCmdTarget::IsInvokeAllowed(long)" (?IsInvokeAllowed@CCmdTarget@@UAEHJ@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CCmdTarget::OnFinalRelease(void)" (?OnFinalRelease@CCmdTarget@@UAEXXZ)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CCmdTarget::OnFinalRelease(void)" (?OnFinalRelease@CCmdTarget@@UAEXXZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CCmdTarget::OnCmdMsg(unsigned int,int,void *,struct AFX_CMDHANDLERINFO *)" (?OnCmdMsg@CCmdTarget@@UAEHIHPAXPAUAFX_CMDHANDLERINFO@@@Z)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CCmdTarget::OnCmdMsg(unsigned int,int,void *,struct AFX_CMDHANDLERINFO *)" (?OnCmdMsg@CCmdTarget@@UAEHIHPAXPAUAFX_CMDHANDLERINFO@@@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual struct CRuntimeClass * __thiscall CWinApp::GetRuntimeClass(void)const " (?GetRuntimeClass@CWinApp@@UBEPAUCRuntimeClass@@XZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: __thiscall CWinApp::CWinApp(char const *)" (??0CWinApp@@QAE@PBD@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CWinApp::~CWinApp(void)" (??1CWinApp@@UAE@XZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol _atexit
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol _atexit
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol _atexit
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: static int __stdcall COleObjectFactory::RegisterAll(void)" (?RegisterAll@COleObjectFactory@@SGHXZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "long __stdcall AfxDllGetClassObject(struct _GUID const &,struct _GUID const &,void * *)" (?AfxDllGetClassObject@@YGJABU_GUID@@0PAPAX@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: __thiscall AFX_MAINTAIN_STATE2::AFX_MAINTAIN_STATE2(class AFX_MODULE_STATE *)" (??0AFX_MAINTAIN_STATE2@@QAE@PAVAFX_MODULE_STATE@@@Z)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "public: __thiscall AFX_MAINTAIN_STATE2::AFX_MAINTAIN_STATE2(class AFX_MODULE_STATE *)" (??0AFX_MAINTAIN_STATE2@@QAE@PAVAFX_MODULE_STATE@@@Z)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "long __stdcall AfxDllCanUnloadNow(void)" (?AfxDllCanUnloadNow@@YGJXZ)
    TiersdeConfiance.obj : error LNK2001: unresolved external symbol "public: static int __stdcall COleObjectFactory::UpdateRegistryAll(int)" (?UpdateRegistryAll@COleObjectFactory@@SGHH@Z)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol ___CxxFrameHandler
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol ___CxxFrameHandler
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol __except_list
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol __except_list
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static struct CRuntimeClass const CCmdTarget::classCCmdTarget" (__imp_?classCCmdTarget@CCmdTarget@@2UCRuntimeClass@@B)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CCmdTarget::~CCmdTarget(void)" (??1CCmdTarget@@UAE@XZ)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol __imp__printf
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "void __stdcall AfxOleLockApp(void)" (?AfxOleLockApp@@YGXXZ)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: void __thiscall CCmdTarget::EnableAutomation(void)" (?EnableAutomation@CCmdTarget@@QAEXXZ)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: __thiscall CCmdTarget::CCmdTarget(void)" (??0CCmdTarget@@QAE@XZ)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "void __stdcall AfxOleUnlockApp(void)" (?AfxOleUnlockApp@@YGXXZ)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: static struct AFX_MSGMAP const CCmdTarget::messageMap" (__imp_?messageMap@CCmdTarget@@1UAFX_MSGMAP@@B)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: static struct AFX_DISPMAP const CCmdTarget::dispatchMap" (__imp_?dispatchMap@CCmdTarget@@1UAFX_DISPMAP@@B)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: static struct AFX_INTERFACEMAP const CCmdTarget::interfaceMap" (__imp_?interfaceMap@CCmdTarget@@1UAFX_INTERFACEMAP@@B)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: __thiscall COleObjectFactory::COleObjectFactory(struct _GUID const &,struct CRuntimeClass *,int,char const *)" (??0COleObjectFactory@@QAE@ABU_GUID@@PAUCRuntimeClass@@HPBD@
    Z)
    TiersdeConfianceAuto.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall COleObjectFactory::~COleObjectFactory(void)" (??1COleObjectFactory@@UAE@XZ)
    LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "public: __thiscall AFX_MODULE_STATE::AFX_MODULE_STATE(int,long (__stdcall*)(struct HWND__ *,unsigned int,unsigned int,long),unsigned long)" (??0AFX_MODULE_STATE@@QAE@HP6GJPAUHWND_
    _@@IIJ@ZK@Z)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "public: static void __stdcall CNoTrackObject::operator delete(void *)" (??3CNoTrackObject@@SGXPAX@Z)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall AFX_MODULE_STATE::~AFX_MODULE_STATE(void)" (??1AFX_MODULE_STATE@@UAE@XZ)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "long __stdcall AfxWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?AfxWndProc@@YGJPAUHWND__@@IIJ@Z)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol __EH_prolog
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "void __stdcall AfxTermThread(struct HINSTANCE__ *)" (?AfxTermThread@@YGXPAUHINSTANCE__@@@Z)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "void __stdcall AfxTermExtensionModule(struct AFX_EXTENSION_MODULE &,int)" (?AfxTermExtensionModule@@YGXAAUAFX_EXTENSION_MODULE@@H@Z)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "int __stdcall AfxUnlockTempMaps(int)" (?AfxUnlockTempMaps@@YGHH@Z)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "void __stdcall AfxLockTempMaps(void)" (?AfxLockTempMaps@@YGXXZ)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "class AFX_MODULE_STATE * __stdcall AfxSetModuleState(class AFX_MODULE_STATE *)" (?AfxSetModuleState@@YGPAVAFX_MODULE_STATE@@PAV1@@Z)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "public: __thiscall CDynLinkLibrary::CDynLinkLibrary(struct AFX_EXTENSION_MODULE &,int)" (??0CDynLinkLibrary@@QAE@AAUAFX_EXTENSION_MODULE@@H@Z)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "int __stdcall AfxInitExtensionModule(struct AFX_EXTENSION_MODULE &,struct HINSTANCE__ *)" (?AfxInitExtensionModule@@YGHAAUAFX_EXTENSION_MODULE@@PAUHINSTANCE__@@@Z)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "void __stdcall AfxWinTerm(void)" (?AfxWinTerm@@YGXXZ)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "class AFX_MODULE_STATE * __stdcall AfxGetModuleState(void)" (?AfxGetModuleState@@YGPAVAFX_MODULE_STATE@@XZ)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "int __stdcall AfxWinInit(struct HINSTANCE__ *,struct HINSTANCE__ *,char *,int)" (?AfxWinInit@@YGHPAUHINSTANCE__@@0PADH@Z)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "class _AFX_THREAD_STATE * __stdcall AfxGetThreadState(void)" (?AfxGetThreadState@@YGPAV_AFX_THREAD_STATE@@XZ)
    mfcs42.lib(dllmodul.obj) : error LNK2001: unresolved external symbol "void __stdcall AfxCoreInitModule(void)" (?AfxCoreInitModule@@YGXXZ)
    OLDNAMES.lib(stat.obi) : error LNK2001: unresolved external symbol __imp___stat
    Release/TiersdeConfiance.dll : fatal error LNK1120: 96 unresolved externals
    Error executing link.exe.

    TiersdeConfiance.dll - 131 error(s), 8 warning(s)[/fixed]

    131 erreurs, je suis désespéré. :sweat:

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

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

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 398
    Par défaut
    Ce sont les includes C qu'il faudra modifier pour ajouter les #ifdef __cplusplus extern "C" { endif là où ils vont bien.

    Tu ne dois absolument pas entourer TOUS les includes de blocs extern "C"...

    Plus d'infos sur extern "C" et la façon de lier C et C++ :
    http://www.developpez.net/forums/sho...12&postcount=4
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  3. #3
    Membre confirmé
    Inscrit en
    Septembre 2006
    Messages
    110
    Détails du profil
    Informations forums :
    Inscription : Septembre 2006
    Messages : 110
    Par défaut
    Ca marche pas mieux, j'ai décorer toutes les déclarations dans les .h en C includés avec le bon vieux :
    #ifdef __cplusplus extern "C" { #endif
    //et bla bla bla
    #ifdef __cplusplus } #endif

    J'ai même plus d'erreurs (134) .

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

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

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 398
    Par défaut
    Je n'ai JAMAIS dit qu'il fallait les mettre sur une ligne... Évidemment que sur une ligne ça foire...
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  5. #5
    Membre confirmé
    Inscrit en
    Septembre 2006
    Messages
    110
    Détails du profil
    Informations forums :
    Inscription : Septembre 2006
    Messages : 110
    Par défaut
    Mais oui, je sais de toute façon sans parler de linkage, ca compilerait pas.

    #ifdef __cplusplus
    extern "C" {
    #endif
    STATUS TEDETIS_E_sendEnvelop(char* envValue, struct SSLSessionInfo* sslSessionHandle, int** returnedEnv, char **erreurlist);

    STATUS TEDETIS_E_getNextDailyEnvSerial(struct SSLSessionInfo* sslSessionHandle, int *serial, char **erreurlist);

    STATUS TEDETIS_E_getStatus(int transaction, struct SSLSessionInfo* sslSessionHandle, int *status, char **erreurlist);
    #ifdef __cplusplus
    }
    #endif


    Vive la France, et vive Java !

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

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

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 398
    Par défaut
    Il faut trouver quelles fonctions sont bien en C, quelles fonctions C++ doivent être accessibles en C,etc.
    Ne pas oublier que le extern "C" doit être consistant: Une fonction C++ doit être à la fois déclarée et définie en extern "C" si elle doit être accessible en C...

    Et aussi, on dirait que beaucoup de tes erreurs sont dues à la CRT et MFC : Tu devrais vérifier les options de linkage de la CRT et MFC...
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  7. #7
    Membre confirmé
    Inscrit en
    Septembre 2006
    Messages
    110
    Détails du profil
    Informations forums :
    Inscription : Septembre 2006
    Messages : 110
    Par défaut
    Je te remercie de ta réponse.

    "Tu devrais vérifier les options de linkage de la CRT et MFC..."

    -> Tu pourrais m'en dire plus à ce sujet (Je viens du monde Java Visual C++ je ne connais pas vraiment).
    Sinon je n'appelle aucune méthode C++ dans du code C.
    Je me contente de faire des #include de headers/sources écrite en C dans un fichier codé en C++.
    D'autres part, mes fichiers codés en C sont nommés en .cpp ... il me semble que ca change de compilo pour VC++ non ?

    Si tu peux m'en apprendre davantage sur la configuration d'un environnement de dev C++ avec Visual C++ 6, je te serais grandement reconnaissant .
    Ca me change du monde java avec Eclipse où je fais un copy/paste d'un .jar, tout ça c'est un calvert pour moi et un peu de charabia ces erreurs

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

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

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 398
    Par défaut
    Citation Envoyé par kroax Voir le message
    mes fichiers codés en C sont nommés en .cpp ...
    Très mauvais. Renomme-les (tu n'as pas de chance d'avoir Visual 6, tu vas devoir les sortir du projet et les y ré-inclure...)

    Si tu peux m'en apprendre davantage sur la configuration d'un environnement de dev C++ avec Visual C++ 6, je te serais grandement reconnaissant .
    Ca me change du monde java avec Eclipse où je fais un copy/paste d'un .jar, tout ça c'est un calvert pour moi et un peu de charabia ces erreurs
    Malheureusement, je ne suis plus très habitué à Visual 6 et je ne l'ai plus : J'utilise Visual 2005 qui est quand même plus pratique à utiliser.
    surtout que j'utilise peu MFC...
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  9. #9
    Membre confirmé
    Inscrit en
    Septembre 2006
    Messages
    110
    Détails du profil
    Informations forums :
    Inscription : Septembre 2006
    Messages : 110
    Par défaut
    Pour un peu je t'aurais presque envoyé le projet si jamais tu arrives à le compiler.

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

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

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 398
    Par défaut
    Si toutes les libs sont présentes, j'arriverais peut-être à le compiler pour Visual 2005 avec MFC 8, mais tu ne pourras rien en faire...
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  11. #11
    Membre confirmé
    Inscrit en
    Septembre 2006
    Messages
    110
    Détails du profil
    Informations forums :
    Inscription : Septembre 2006
    Messages : 110
    Par défaut
    Ouai, laisse tomber, faut le compiler avec VC++ 6 sinon ça avance à rien.
    Faudrait que je parle avec un expert VC++6 qui connait bien l'environnement de dev.
    Merci quand même!

  12. #12
    Membre confirmé
    Inscrit en
    Septembre 2006
    Messages
    110
    Détails du profil
    Informations forums :
    Inscription : Septembre 2006
    Messages : 110
    Par défaut
    J'ai renommé en .c et voilà la résultat :

    Deleting intermediate files and output files for project 'TiersdeConfiance - Win32 Release'.
    --------------------Configuration: TiersdeConfiance - Win32 Release--------------------
    Creating Type Library...
    Processing D:\prog\vc++6\TiersdeConfiance\TiersdeConfiance.odl
    TiersdeConfiance.odl
    Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\oaidl.idl
    oaidl.idl
    Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\objidl.idl
    objidl.idl
    Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\unknwn.idl
    unknwn.idl
    Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\wtypes.idl
    wtypes.idl
    Compiling resources...
    Compiling...
    StdAfx.cpp
    Compiling...
    TiersdeConfiance.cpp
    TiersdeConfianceAuto.cpp
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(28) : warning C4273: 'fread' : inconsistent dll linkage. dllexport assumed.
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(29) : warning C4273: 'fwrite' : inconsistent dll linkage. dllexport assumed.
    Generating Code...
    Compiling...
    Session.c
    C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afx.h(15) : fatal error C1189: #error : MFC requires C++ compilation (use a .cpp suffix)
    Constant.c
    C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afx.h(15) : fatal error C1189: #error : MFC requires C++ compilation (use a .cpp suffix)
    Log.c
    C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afx.h(15) : fatal error C1189: #error : MFC requires C++ compilation (use a .cpp suffix)
    tedetisSession.c
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(28) : warning C4273: 'fread' : inconsistent dll linkage. dllexport assumed.
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(29) : warning C4273: 'fwrite' : inconsistent dll linkage. dllexport assumed.
    tedetisEnvelop.c
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(28) : warning C4273: 'fread' : inconsistent dll linkage. dllexport assumed.
    C:\TEDETIS\LIBCURL-7.15.1-MSVC-WIN32-SSL-0.9.8A-ZLIB-1.2.3\INCLUDE\curl/stdcheaders.h(29) : warning C4273: 'fwrite' : inconsistent dll linkage. dllexport assumed.
    Generating Code...
    Error executing cl.exe.

    TiersdeConfiance.dll - 3 error(s), 6 warning(s)



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

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

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 398
    Par défaut
    1. Il y a un truc bizarre dans les headers de curl : On dirait qu'ils re-déclarent les fonctions standard, d'où les warnings...
    2. Pour les erreurs de #error des fichiers .c, elles mettent en évidence quelque chose de pas normal : Ces fichiers C incluent afx.h, qui est un header C++ MFC! Il faut donc corriger cela et empêcher qu'ils incluent ce header dont ils censés n'avoir rien à faire.

    PS: Tu aurais pu prévenir que tu utilises curl : Je pensais que tu n'utilisais aucune bibliothèque extérieure...
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  14. #14
    Membre confirmé
    Inscrit en
    Septembre 2006
    Messages
    110
    Détails du profil
    Informations forums :
    Inscription : Septembre 2006
    Messages : 110
    Par défaut
    En fait si, j'utilise bien du C++ dans du C :

    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
    /***********************************
     * Constant.h
     * Write logs.
     *
     * Author : François FOURNEL
     * Application : TiersdeConfiance
     * Date : October 2007
     * Email : ffournel@ntsys.fr 
     ************************************/
    #ifndef CONSTANT_H
    #define CONSTANT_H
     
    #include "stdafx.h"
     
    //RETURN CODES
    #define SUCCESS_CODE_RET 1
    #define UNIMPLEMENTED_METHOD_CODE_RET -1
     
    //VERSIONDLL() arguments
    #define TDC_NAME "S²LOW"
    #define TDC_VERSION_DLL "1.0"
     
    //CONF
    #define LOG_FILENAME "tdc-log.txt"
    #define CONF_FILENAME "tdc-conf.txt"
     
     
    //LOGS
     
    //total log message number
    #define LOG_NB_MSG 19
    //unique log codes
    #define UNKNOWN_CODE_ERR 0
    #define CONF_FILE_NOT_FOUND_CODE_ERR 1
    #define SESSION_NEW_CODE_ERR 2
    #define SESSION_MAX_CODE_ERR 3
    #define SESSION_SET_NEW_CODE_ERR 4
    #define INVALID_CONF_FILE_CODE_ERR 5
    #define INVALID_CERT_FILE_CODE_ERR 6
    #define MISSING_CONF_DATA_CODE_ERR 7
    #define MISSING_LIB_xxx_CODE_ERR 8
    #define SESSION_INVALID_CODE_ERR 9
    #define SIGN_CODE_ERR 10
    #define STATUS1_CODE_ERR 11
    #define STATUS2_CODE_ERR 12
    #define STATUS3_CODE_ERR 13
    #define STATUS4_CODE_ERR 14
    #define STATUS5_CODE_ERR 15
    #define STATUS6_CODE_ERR 16
    #define STATUS7_CODE_ERR 17
    #define CERT_NOT_FOUND_CODE_ERR 18
    //log messages
    #define UNKNOWN_MSG_ERR "Code erreur inconnu."
    #define CONF_FILE_NOT_FOUND_MSG_ERR "Erreur d'ouverture du fichier de configuration."
    #define SESSION_NEW_MSG_ERR "Erreur de création de la session."
    #define SESSION_MAX_MSG_ERR "Nombre maximal de session ouverte atteint."
    #define SESSION_SET_NEW_MSG_ERR "Erreur de création de la session."
    #define INVALID_CONF_FILE_MSG_ERR "Erreur de lecture du fichier de configuration."
    #define INVALID_CERT_FILE_MSG_ERR "Erreur de lecture du fichier certificat."
    #define MISSING_CONF_DATA_MSG_ERR "Erreur de démarrage de l'application spécifiée dans le fichier de configuration (applicationURL)."
    #define MISSING_LIB_xxx_MSG_ERR "Erreur d'initialisation de la communication HTTP (curl_global_init)."
    #define SESSION_INVALID_MSG_ERR "Erreur d'identification de la session."
    #define SIGN_MSG_ERR "Erreur de signature."
    #define STATUS1_MSG_ERR "Erreur."
    #define STATUS2_MSG_ERR "Posté."
    #define STATUS3_MSG_ERR "En attente de transmission."
    #define STATUS4_MSG_ERR "Transmis."
    #define STATUS5_MSG_ERR "Ack."
    #define STATUS6_MSG_ERR "Nack."
    #define STATUS7_MSG_ERR "En traitement."
    #define CERT_NOT_FOUND_MSG_ERR "Certificat non trouvé."
     
    //array map between codes and messages
    static const char *log_messages[LOG_NB_MSG] = {
    	UNKNOWN_MSG_ERR,
    	CONF_FILE_NOT_FOUND_MSG_ERR,
    	SESSION_NEW_MSG_ERR,
    	SESSION_MAX_MSG_ERR,
    	SESSION_SET_NEW_MSG_ERR,
    	INVALID_CONF_FILE_MSG_ERR,
    	INVALID_CERT_FILE_MSG_ERR,
    	MISSING_CONF_DATA_MSG_ERR,
    	MISSING_LIB_xxx_MSG_ERR,
    	SESSION_INVALID_MSG_ERR,
    	SIGN_MSG_ERR,
    	STATUS1_MSG_ERR,
    	STATUS2_MSG_ERR,
    	STATUS3_MSG_ERR,
    	STATUS4_MSG_ERR,
    	STATUS5_MSG_ERR,
    	STATUS6_MSG_ERR,
    	STATUS7_MSG_ERR,
    	CERT_NOT_FOUND_MSG_ERR
    	};
     
     
     
    const char* get_value(const char *key);
    void BSTRtoASC (BSTR str, char * &strRet);
    void ASCtoBSTR (char * str, BSTR * strRet);
     
     
    #endif

  15. #15
    Membre confirmé
    Inscrit en
    Septembre 2006
    Messages
    110
    Détails du profil
    Informations forums :
    Inscription : Septembre 2006
    Messages : 110
    Par défaut
    j'utilise curl, openssl, glib et libxml2

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

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

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 398
    Par défaut
    Y'a rien de C++ dans ce que tu m'as montré.
    Par contre, c'est l'inclusion de stdafx.h qui va géner : Le stdafx.h d'un projet MFC n'est absolument pas approprié pour du C.
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  17. #17
    Membre confirmé
    Inscrit en
    Septembre 2006
    Messages
    110
    Détails du profil
    Informations forums :
    Inscription : Septembre 2006
    Messages : 110
    Par défaut
    Ce prototype met en jeu un type C++ :

    void BSTRtoASC (BSTR str, char * &strRet);

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

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

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 398
    Par défaut
    Entoure-le de #ifdef __cplusplus dans ton fichier d'en-tête.
    S'il est utilisé depuis le C, fais-en un wrapper :
    Code C : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    /* wrapper.h */
    #ifndef EXTERN_C
    #	ifdef __cplusplus
    #		define EXTERN_C extern "C"
    #	else
    #		define EXTERN_C extern
    #	endif
    #endif
     
    EXTERN_C void BSTRtoASC_C(BSTR str, char **pstrRet);
    Code C++ : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    //Wrapper.cpp
     
    extern "C" void BSTRtoASC_C(BSTR str, char **pstrRet)
    {
    	BSTRtoASC(str, *pstrRet);
    }
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  19. #19
    Membre Expert
    Avatar de poukill
    Profil pro
    Inscrit en
    Février 2006
    Messages
    2 155
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France

    Informations forums :
    Inscription : Février 2006
    Messages : 2 155
    Par défaut
    Citation Envoyé par Médinoc Voir le message
    Y'a rien de C++ dans ce que tu m'as montré.
    Par contre, c'est l'inclusion de stdafx.h qui va géner : Le stdafx.h d'un projet MFC n'est absolument pas approprié pour du C.
    Le stdafx.h, c'est pas juste l'en-tête précompilé de Visual?

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

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

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 398
    Par défaut
    C'est l'en-tête qui servira à créer l'en-tête précompilé, qui lui sera un fichier avec l'extension .pch.
    Cet en-tête doit absolument être inclus dans tout fichier source réglé pour utiliser l'en-tête précompilé.

    Mais vu qu'un fichier source C ne peut pas utiliser un PCH C++, les fichiers sources C n'ont aucune raison d'inclure stdafx.h dans un projet MFC.
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

Discussions similaires

  1. Réponses: 0
    Dernier message: 01/03/2009, 14h44
  2. Réponses: 0
    Dernier message: 29/11/2008, 09h19
  3. Réponses: 2
    Dernier message: 12/11/2008, 19h33
  4. Réponses: 3
    Dernier message: 02/03/2008, 17h02
  5. [C#][Visual C# Express] Gros souci avec Excel
    Par poullos dans le forum EDI/Outils
    Réponses: 7
    Dernier message: 18/11/2005, 13h15

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