Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Dcom working on the client(suppose to work work on the server)

Dcom working on the client(suppose to work work on the server)

Scheduled Pinned Locked Moved COM
databasesysadminquestionannouncement
3 Posts 3 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hushpappy
    wrote on last edited by
    #1

    I have build a dcom that update data on a db. the dcom sits on the server and so is the db. i'm registering the server as : "\\computer_name\dcom.exe" /regserver some how, the dcom who suppose to work on the server is working on the client, so he search for the db on the client and not over the server. what should i do? any code will be great, i can send the code to you. please .. i'm so :confused: . thanks, /// (.)_(.) oOO(.)OOo

    L J 2 Replies Last reply
    0
    • H Hushpappy

      I have build a dcom that update data on a db. the dcom sits on the server and so is the db. i'm registering the server as : "\\computer_name\dcom.exe" /regserver some how, the dcom who suppose to work on the server is working on the client, so he search for the db on the client and not over the server. what should i do? any code will be great, i can send the code to you. please .. i'm so :confused: . thanks, /// (.)_(.) oOO(.)OOo

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      > i'm registering the server as : > "\\computer_name\dcom.exe" /regserver This does not tell COM to instantiate the COM server on computer_name, but rather to retrieve the disk file that houses the server from computer_name. COM does so and then instantiates the COM server on the local machine using the bits from the disk file located on computer_name. The quickest way to achieve what you want is to register the COM server locally, then use dcomcnfg to modify the registration for instantiating on computer_name. The soundest way to achieve what you want is to use CoCreateInstanceEx() to create the COM server and directly tell COM to instantiate the COM service on computer_name. This way, your configuration can't be botched after installation by misuse of dcomcnfg. It would be a good idea to study any indroductory DCOM text book for details. Also search MSDN for dcomcnfg and CoCreateInstanceEx.

      1 Reply Last reply
      0
      • H Hushpappy

        I have build a dcom that update data on a db. the dcom sits on the server and so is the db. i'm registering the server as : "\\computer_name\dcom.exe" /regserver some how, the dcom who suppose to work on the server is working on the client, so he search for the db on the client and not over the server. what should i do? any code will be great, i can send the code to you. please .. i'm so :confused: . thanks, /// (.)_(.) oOO(.)OOo

        J Offline
        J Offline
        John McTainsh
        wrote on last edited by
        #3

        Hi Hush, You may be registering the exe on your machine rather than the remote machine. You need to run "dcom.exe /regserver" from the client and FROM the server. This can not be done remotely (as far as I know?). I have come across this problem often enough to include the following code in the remote classes to tell me where it is running. // *************************************************************************** //DESCRIPTION: // Return the machine name of the machine running this code. //PARAMS: // *pbsrtMachine Name returned here //RETURN: // Standard HRESULT //CREATED: // 1-2-2001, 16:51:31 by john@mctainsh.com // *************************************************************************** STDMETHODIMP CWhereAmI::GetMachine(BSTR *pbstrMachine) { ATLTRACE( _T("CWhereAmI::GetMachine(%p)\n"), pbstrMachine ); ATLASSERT( pbstrMachine ); USES_CONVERSION; //Get my name DWORD dwComputerNameLength = MAX_COMPUTERNAME_LENGTH + 1; TCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 2]; if( GetComputerName( szComputerName, &dwComputerNameLength ) ) szComputerName[dwComputerNameLength] = NULL; else _tcscpy( szComputerName, _T("Unknown") ); *pbstrMachine = SysAllocString( T2W( szComputerName ) ); return S_OK; } --------------------------------------------------- I have a note on DCOM remoting at http://www.mctainsh.com/COM/SmartPtr3.aspx The hardest thing I find is getting security correct. Let me know how you get on... Have a great day! http://www.mctainsh.com

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups