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++Builder Discussion :

Serveur/client COM sur des PC différents


Sujet :

C++Builder

  1. #1
    Membre habitué Avatar de sylvain.cool
    Profil pro
    Étudiant
    Inscrit en
    Janvier 2006
    Messages
    242
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2006
    Messages : 242
    Points : 158
    Points
    158
    Par défaut Serveur/client COM sur des PC différents
    Bonjour,

    J'essaie actuellement de mettre un objet COM en réseau.

    Jusqu'ici, j'ai réussi à créer un serveur et un client, mais sur la même machine.

    J'arrive pas trop à voir comment faire pour que cet objet COM soit accessible depuis un autre PC.

    Quelqu'un a-t-il une idée, une piste ou de la documentation???

    Merci d'avance et demandez des précisions si c'est pas clair.

  2. #2
    Membre régulier Avatar de marcootz
    Homme Profil pro
    Inscrit en
    Décembre 2006
    Messages
    159
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Décembre 2006
    Messages : 159
    Points : 104
    Points
    104
    Par défaut
    Salut,
    Quel composant ou librairie as tu utilisé pour faire ton COM ??

  3. #3
    Membre habitué Avatar de sylvain.cool
    Profil pro
    Étudiant
    Inscrit en
    Janvier 2006
    Messages
    242
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2006
    Messages : 242
    Points : 158
    Points
    158
    Par défaut
    Ben j'utilise, ATL.
    Et le type de projet de C++builder "Objet COM".

    Je sais pas trop si c'est le style de réponse que tu attendait.

  4. #4
    Membre habitué Avatar de sylvain.cool
    Profil pro
    Étudiant
    Inscrit en
    Janvier 2006
    Messages
    242
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2006
    Messages : 242
    Points : 158
    Points
    158
    Par défaut
    Voila,

    J'ai un projet avec un serveur et un client COM.

    En local (même PC pour le client et le serveur), ça marche. Par contre, si je veux l'exécuter depuis un autre PC, ça ne marche plus.

    J'ai créer une librairie ActiveX qui me définit l'interface. De là, une dll est construite et je la recense.

    Derrière, je créé exécutable qui enregistre l'objet. Cet exe tourne au moment ou je lance le client.

    Coté client, j'ai un exécutable qui essaie d'appeler l'objet situé sur un autre PC. L'interface définit ci-dessus est également recenser sur le PC client.

    La méthode CoCreateInstanceEx appellée par le client renvoie :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    None of the interfaces requested in the pResults array were successfully retrieved.
    Ci-dessous, le code du client :
    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
     
    //---------------------------------------------------------------------------
     
    #include <vcl.h>
    #include <iostream>
    #include <string> 
    #include <stdio.h>
    #include <Winsock2.h>
     
    #pragma hdrstop
    #include "testServeurCOM_TLB.h"
     
    USEUNIT("..\testServeurCOM\testServeurCOM_TLB.cpp");
     
    //---------------------------------------------------------------------------
    int main()
    {     
      HRESULT reponse; 
      TCOMITestServeurCOMT<TTestServeurCOM> serveur; 
     
     
      //Sur le reseau
      /***********************************************************/
      /***********************************************************/
      /**                   Initialisation                      **/
      /***********************************************************/
      /***********************************************************/ 
     
      std::cout<< "Initialize: " << std::endl;
      if(!SUCCEEDED(reponse=CoInitialize(NULL)))  
           switch(reponse){
                          case S_OK:
                               std::cout << "The COM library was initialized successfully on this thread." << std::endl;
                               break;  
                          case S_FALSE:
                               std::cout << "The COM library is already initialized on this thread.." << std::endl;
                               break;
                          case RPC_E_CHANGED_MODE:
                               std::cout << "A previous call to CoInitializeEx specified the concurrency model for this thread as multithread apartment (MTA). If running Windows 2000, this could also mean that a change from neutral-threaded apartment to single-threaded apartment occurred." << std::endl;
                               break;
                          default:
                               std::cout << "Reponse inconnue???: 0x" << std::hex << reponse << std::endl;
                               break;
           }
      else
          std::cout << "The COM library was initialized successfully on this thread." << std::endl;
     
     
      /***********************************************************/
      /***********************************************************/
      /**              Avec CoCreateInstanceEx                  **/
      /***********************************************************/
      /***********************************************************/ 
     
      std::cout << std::endl << "CoCreateInstanceEx: " << std::endl;
     
      // Création de la structure MULTI_QI
      MULTI_QI multiQiRes;
      multiQiRes.pIID = &IID_ITestServeurCOM, //& IID_IUnknown;
      multiQiRes.pItf = NULL;   
      multiQiRes.hr = 0;
     
      //Creation du COSERVERINFO
      COSERVERINFO serveurInfo;
      wchar_t serveurName[] = L"UC06P1556.fr.pierre-fabre.lcl"; 
      serveurInfo.pwszName = serveurName;
      serveurInfo.pAuthInfo = NULL;
      serveurInfo.dwReserved1 = 0; 
      serveurInfo.dwReserved2 = 0;
     
      //std::cout << std::endl << "Nom du serveur: " << nomduserveur << std::endl;
      std::wcout << "Nom du serveur: " << serveurInfo.pwszName << std::endl;
     
      reponse=CoCreateInstanceEx(CLSID_TTestServeurCOM, NULL, CLSCTX_ALL, NULL, 1, &multiQiRes);//&serveurInfo, 1, &multiQiRes);
      //CLSCTX_REMOTE_SERVER|CLSCTX_LOCAL_SERVER
     
      if(!SUCCEEDED(reponse))
          switch(reponse){ 
    					  case REGDB_E_CLASSNOTREG:
                               std::cout << "A specified class is not registered in the registration database. Also can indicate that the type of server you requested in the CLSCTX enumeration is not registered or the values for the server types in the registry are corrupt." << std::endl;
                               break;
    					  case E_NOINTERFACE:
                               std::cout << "None of the interfaces requested in the pResults array were successfully retrieved." << std::endl;
    						   break;
    					  case CLASS_E_NOAGGREGATION:
    						   std::cout << "This class cannot be created as part of an aggregate." << std::endl;
    						   break; 
    					  case CO_S_NOTALLINTERFACES:
    						   std::cout << "At least one, but not all of the interfaces requested in the pResults array were successfully retrieved. The hr field of each of the MULTI_QI structures in pResults indicates with S_OK or E_NOINTERFACE whether the specific interface was returned." << std::endl;
    						   break;
                          default:
    						   std::cout << "Reponse inconnue???: 0x" << std::hex << reponse << std::endl;
                               break;
          } 
      else{
           std::cout << "Location and connection to the specified class object was successful." << std::endl;
           serveur = static_cast< ITestServeurCOM * >(multiQiRes.pItf);
      }
     
     
     
      /***********************************************************/
      /***********************************************************/
      /**          Appel de la methode à distance               **/
      /***********************************************************/
      /***********************************************************/ 
     
      if( SUCCEEDED(reponse) ){  
                 std::cout << std::endl << "Appel de l'objet distant:" << std::endl;
                 std::wcout << "Nombre de processeurs: " << serveur.Nombre << " et voila." << std::endl;
      }
     
      system("PAUSE");
     
      return 0;
    }
    //---------------------------------------------------------------------------

    Code du exe coté serveur :
    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
     
    //---------------------------------------------------------------------------
     
    #include <vcl.h>
    #pragma hdrstop
     
    #include <iostream>
    #include "testServeurCOM_TLB.h"
     
    //---------------------------------------------------------------------------
     
    #pragma argsused
    int main(int argc, char* argv[])
    {
        TCOMITestServeurCOMT<TTestServeurCOM> serveur = CoTTestServeurCOM::Create();
        IUnknown * serveurPtr = serveur;
        LPDWORD objectNumber = new DWORD;
        //int reponse;
     
        // On enregistre le serveur CLSCTX_REMOTE_SERVER|CLSCTX_LOCAL_SERVER
        if(SUCCEEDED(CoRegisterClassObject(CLSID_TTestServeurCOM, serveurPtr, CLSCTX_REMOTE_SERVER|CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, objectNumber)))
                        std::cout << "Serveur enregistre: " << *objectNumber << std::endl;
        else
                        std::cout << "Serveur NON enregistre."  << std::endl;
     
        // On attend une connexion
        MessageBox(NULL, TEXT("Cliquer OK pour quitter"), TEXT("Serveur COM"), MB_OK);
     
        std::cout << std::endl;
     
        // On dereference l'objet
        if(SUCCEEDED(CoRevokeClassObject(*objectNumber)))
                        std::cout << "Serveur desenregistre: " << *objectNumber << std::endl;
        else
                        std::cout << "Serveur NON desenregistre."  << std::endl;
     
        system("PAUSE");
     
        return 0;
    }
    //---------------------------------------------------------------------------
    Quelqu'un a-t-il une idée de pourquoi ça ne marche pas?

  5. #5
    Membre chevronné
    Avatar de DjmSoftware
    Homme Profil pro
    Responsable de compte
    Inscrit en
    Mars 2002
    Messages
    1 044
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Suisse

    Informations professionnelles :
    Activité : Responsable de compte
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2002
    Messages : 1 044
    Points : 2 187
    Points
    2 187
    Billets dans le blog
    1
    Par défaut
    Ne serait-il pas plus judicieux d'utiliser la technologie DCOM en lieu et place de COM
    Cordialement

  6. #6
    Membre habitué Avatar de sylvain.cool
    Profil pro
    Étudiant
    Inscrit en
    Janvier 2006
    Messages
    242
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2006
    Messages : 242
    Points : 158
    Points
    158
    Par défaut
    J'ai dit COM en pensant DCOM.
    Les fonctions que j'utilise dans le code viennent de DCOM.

  7. #7
    Membre habitué Avatar de sylvain.cool
    Profil pro
    Étudiant
    Inscrit en
    Janvier 2006
    Messages
    242
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2006
    Messages : 242
    Points : 158
    Points
    158
    Par défaut
    Personne ne connait DCOM sous C++Builder (de préférence 2007)?

  8. #8
    Membre habitué Avatar de sylvain.cool
    Profil pro
    Étudiant
    Inscrit en
    Janvier 2006
    Messages
    242
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2006
    Messages : 242
    Points : 158
    Points
    158
    Par défaut
    Pas même quelques liens sur comment créer des serveurs/clients COM out-of-process avec C++builder?

  9. #9
    Membre habitué Avatar de sylvain.cool
    Profil pro
    Étudiant
    Inscrit en
    Janvier 2006
    Messages
    242
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2006
    Messages : 242
    Points : 158
    Points
    158
    Par défaut
    Pour infos, je suis passé par l'utilisation de CoGetClassObject.

    Mais j'ai l'erreur:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    Either the object pointed to by ppv does not support the interface identified by riid, or the QueryInterface operation on the class object returned E_NOINTERFACE.
    Le code correspondant:
    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
     
    //---------------------------------------------------------------------------
     
    #include <vcl.h>
    #include <iostream>
    #include <string> 
    #include <stdio.h>
    #include <Winsock2.h>
     
    #include <tchar.h>
     
    #pragma hdrstop
    #include "ServeurCOMtest_TLB.h"
     
    USEUNIT("ServeurCOMtest_TLB.cpp");
     
    //---------------------------------------------------------------------------
    int main()
    {     
      HRESULT reponse; 
      TCOMIServeurCOMT<ServeurCOM> serveur; 
     
      /***********************************************************/
      /***********************************************************/
      /**                   Initialisation                      **/
      /***********************************************************/
      /***********************************************************/ 
     
      std::cout<< "Initialize: " << std::endl;
      if(!SUCCEEDED(reponse=CoInitialize(NULL)))  
           switch(reponse){
                          case S_OK:
                               std::cout << "The COM library was initialized successfully on this thread." << std::endl;
                               break;  
                          case S_FALSE:
                               std::cout << "The COM library is already initialized on this thread.." << std::endl;
                               break;
                          case RPC_E_CHANGED_MODE:
                               std::cout << "A previous call to CoInitializeEx specified the concurrency model for this thread as multithread apartment (MTA). If running Windows 2000, this could also mean that a change from neutral-threaded apartment to single-threaded apartment occurred." << std::endl;
                               break;
                          default:
                               std::cout << "Reponse inconnue???: 0x" << std::hex << reponse << std::endl;
                               break;
           }
      else
          std::cout << "The COM library was initialized successfully on this thread." << std::endl;
     
     
     
      /***********************************************************/
      /***********************************************************/
      /**              Avec CoGetClassObject                    **/
      /***********************************************************/
      /***********************************************************/ 
     
      std::cout<< std::endl << "Get Object: " << std::endl;
     
      // Structure "login" pr se connecter sur le PC serveur
      COAUTHIDENTITY userLoginOnServeur;
      userLoginOnServeur.User = L"coulois"; 
      userLoginOnServeur.UserLength = 7;
      userLoginOnServeur.Domain = L"fr"; 
      userLoginOnServeur.DomainLength = 2; 
      userLoginOnServeur.Password = L"tagada65"; 
      userLoginOnServeur.PasswordLength = 8; 
      userLoginOnServeur.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; 
     
      // Structure Info auteur
      COAUTHINFO authentification;
      authentification.dwAuthnSvc = RPC_C_AUTHN_DEFAULT;
      authentification.dwAuthzSvc = RPC_C_AUTHZ_DEFAULT;
      authentification.pwszServerPrincName = NULL;
      authentification.dwAuthnLevel = RPC_C_AUTHN_LEVEL_DEFAULT;
      authentification.dwImpersonationLevel = RPC_C_IMP_LEVEL_IMPERSONATE;
      authentification.pAuthIdentityData = &userLoginOnServeur;
      authentification.dwCapabilities = EOAC_NONE;
     
      //Creation du COSERVERINFO
      COSERVERINFO serveurInfo;
      wchar_t serveurName[] = L"UC06P1556.fr.pierre-fabre.lcl";
      //std::wstring serveurName = L"UC06P1556.fr.pierre-fabre.lcl";  
      serveurInfo.pwszName = serveurName;
      serveurInfo.pAuthInfo = &authentification;
      serveurInfo.dwReserved1 = 0; 
      serveurInfo.dwReserved2 = 0;
     
      //Création de la ClassFactory
      IClassFactory * pFactory;
      //CLSCTX_REMOTE_SERVER|CLSCTX_LOCAL_SERVER   CLSCTX_ALL
      reponse=CoGetClassObject(CLSID_ServeurCOM, CLSCTX_REMOTE_SERVER, /*NULL*/&serveurInfo, IID_IClassFactory, reinterpret_cast<void**>(&pFactory));  // IID_IClassFactory
      if(!SUCCEEDED(reponse))
    	   switch(reponse){
                          case REGDB_E_CLASSNOTREG:
                               std::cout << "CLSID is not properly registered. Can also indicate that the value you specified in dwClsContext is not in the registry." << std::endl;
                               break;
                          case E_NOINTERFACE:
                               std::cout << "Either the object pointed to by ppv does not support the interface identified by riid, or the QueryInterface operation on the class object returned E_NOINTERFACE." << std::endl;
                               break;
                          case REGDB_E_READREGDB:
                               std::cout << "Error reading the registration database." << std::endl;
                               break;
                          case CO_E_DLLNOTFOUND:
                               std::cout << "In-process DLL or handler DLL not found (depends on context)." << std::endl;
                               break;
                          case CO_E_APPNOTFOUND:
                               std::cout << "EXE not found (CLSCTX_LOCAL_SERVER only)." << std::endl;
                               break;
                          case E_ACCESSDENIED:
                               std::cout << "General access failure (returned from LoadLib/CreateProcess)." << std::endl;
                               break;
                          case CO_E_ERRORINDLL:
                               std::cout << "EXE has error in image." << std::endl;
                               break; 
                          case CO_E_APPDIDNTREG:
                               std::cout << "EXE was launched, but it didn't register class object (may or may not have shut down)." << std::endl;
                               break;
                          case CO_E_NOTINITIALIZED:
                               std::cout << "CO_E_NOTINITIALIZED." << std::endl;
                               break;
                          default:
    						   std::cout << "Reponse inconnue???: 0x" << std::hex << reponse << std::endl;
    						   DWORD dw = reponse;
     
    						   LPTSTR lpszFunction  = "CoGetClassObject";
    						   LPVOID lpMsgBuf;
    						   LPVOID lpDisplayBuf;
     
    						   FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
    							NULL,
    							dw,
    							MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
    							(LPTSTR) &lpMsgBuf,
    							0, NULL );
     
    						   lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT,
    								(lstrlen((LPCTSTR)lpMsgBuf)+lstrlen((LPCTSTR)lpszFunction)+40)*sizeof(TCHAR));
    						   wsprintf((LPTSTR)lpDisplayBuf,
    								TEXT("%s failed with error %d: %s"),
    								lpszFunction, dw, lpMsgBuf);
     
    						   MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK);
     
    						   LocalFree(lpMsgBuf);
    						   LocalFree(lpDisplayBuf);
     
                               break;
           } 
      else{
           std::cout << "Location and connection to the specified class object was successful." << std::endl;
     
           std::cout<< std::endl << "CreateInstance: " << std::endl;
     
     
           //Création de l'objet
    	   void * pvObj = NULL;
    	   reponse = pFactory->CreateInstance(NULL, IID_IServeurCOM, &pvObj);
           if(!SUCCEEDED(reponse))
                switch(reponse){ 
                              case CLASS_E_NOAGGREGATION:
                                   std::cout << "The pUnkOuter parameter was non-NULL and the object does not support aggregation." << std::endl;
                                   break;
                              case E_NOINTERFACE:
                                   std::cout << "The object that ppvObject points to does not support the interface identified by riid." << std::endl;
                                   break;
                              default:
    							   std::cout << "Reponse inconnue???: 0x" << std::hex << reponse << std::endl;
    							   DWORD dw = reponse;
     
    							   LPTSTR lpszFunction  = "pFactory->CreateInstance";
    							   LPVOID lpMsgBuf;
    							   LPVOID lpDisplayBuf;
     
    							   FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
    									NULL,
    									dw,
    									MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
    									(LPTSTR) &lpMsgBuf,
    									0, NULL );
     
    							   lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT,
    										(lstrlen((LPCTSTR)lpMsgBuf)+lstrlen((LPCTSTR)lpszFunction)+40)*sizeof(TCHAR));
    							   wsprintf((LPTSTR)lpDisplayBuf,
    										TEXT("%s failed with error %d: %s"),
    										lpszFunction, dw, lpMsgBuf);
     
    							   MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK);
     
    							   LocalFree(lpMsgBuf);
    							   LocalFree(lpDisplayBuf);
                                   break;
                } 
    	   else{
                std::cout << "The specified object was created." << std::endl;
     
                std::cout<< std::endl << "Release. " << std::endl;
     
                pFactory->Release(), pFactory=NULL; 
     
                //Je ne sais pas comment on assigne un pointeur de référence à un pointeur intelligent Borland.
                //Mais ce doit être un truc de ce genre
                serveur = static_cast< IServeurCOM * >(pvObj);
          } 
      }
     
     
     
      /***********************************************************/
      /***********************************************************/
      /**          Appel de la methode à distance               **/
      /***********************************************************/
      /***********************************************************/ 
     
      if( SUCCEEDED(reponse) ){
                 std::cout << std::endl << "Appel de l'objet distant:" << std::endl;
                 std::wcout << "Nom du PC: " << serveur.NomDuPC << " et voila." << std::endl;
      }
     
      system("PAUSE");
     
      return 0;
    }
    //---------------------------------------------------------------------------
    Le serveur est le même que ci-dessus.

  10. #10
    Membre habitué Avatar de sylvain.cool
    Profil pro
    Étudiant
    Inscrit en
    Janvier 2006
    Messages
    242
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2006
    Messages : 242
    Points : 158
    Points
    158
    Par défaut
    En fait, je n'ai pas commencé avec le bon type de projet.

    Voici un tutoriel qui explique un peu.

    Ne pas oublier de configurer DCOM comme ceci.

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

Discussions similaires

  1. Réponses: 1
    Dernier message: 21/03/2012, 12h16
  2. Réponses: 0
    Dernier message: 27/09/2011, 18h28
  3. Serveurs managés sur des machines différentes
    Par miko2009 dans le forum Weblogic
    Réponses: 4
    Dernier message: 24/06/2009, 09h52
  4. Réponses: 2
    Dernier message: 02/12/2005, 04h28
  5. [Studio .NET] Executable qui marche sur des PC différents
    Par black is beautiful dans le forum Autres Logiciels
    Réponses: 3
    Dernier message: 05/10/2005, 17h00

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