Results 1 to 6 of 6

Thread: [RESOLVED] ActiveX server and DCOM

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2006
    Posts
    18

    Resolved [RESOLVED] ActiveX server and DCOM

    OK, I have quite a tangle.

    I have created an ActiveX exe out-of-process server (the class is called Locator.Locator), which implements an interface I've invented and called ILocator. The Locator object currently has an instancing type of MultiUse (with 1 thread in its thread pool, if that makes a difference).

    I have a Standard exe that accesses this server using a CreateObject call
    VB Code:
    1. Dim IL As ILocator
    2. Set IL= CreateObject("Locator.Locator")
    Even though this call is sometimes repeated several times during the course of the program's execution, it always connects to the same object, as long as something doesn't kill the ActiveX exe process.

    That's what's happening when I'm running both on the same computer, which is exactly what we want to happen.

    I want to run the server process on several machines in the network, with each of them communicating with each other, sharing information. The purpose behind this, by the way, is graceful failure, so that if any of them goes down, the rest of the networked computers can allow for this, and recover. Therefore I've put a function onto the ILocator interface whose implementation looks like this:
    VB Code:
    1. Private Sub ILocator_Connect(Machine As String)
    2.     Dim IL As ILocator
    3.     'Some code here to make sure Machine is a valid name
    4.     Set IL=CreateObject("Locator.Locator",Machine)
    5.     If Err Or IL Is Nothing Then
    6.             MsgBox "Could not connect to " & Machine & ": (" & Err & ") " & Err.Description, , "Connection Error"
    7.             Err.Clear
    8.             Exit Sub
    9.     End If
    10.     'Some code here to add IL to a collection for later access
    11. End Sub

    Ideally, this function would connect to the server process running on Machine, and return its ILocator interface. I would like it to behave exactly like all the other CreateObject calls, so that it won't create multiple copies of the server process.

    Here's where I seem to start running into DCOM issues. Right now, my DCOM settings (on both computers) are set this way:
    Default Authentication Level: None
    Default Impersonation Leve: Anonymous
    Default Security allows launch and access to Everyone, Interactive, and System
    Locator.Locator settings:
    Authentication Level: Default
    Location: Run on this Computer
    Security: Default Launch and Access
    Identity: The launching user

    When I set it up this way, the CreateObject call works properly as long as the same user is logged on to both computers. If different users are signed on, and the user on the other machine is already running the process server, I get a new copy of the process server. Once I looked into it, I found that this was expected behavior for Identity: the launching user, because the two processes belong to different people.

    If I change the identity option to "The interactive user", which is supposed to use the security scope of the person logged on, the connect process causes the process to stop responding (apparently because it is getting no answer). And anyway, we don't want to use this option because you have to have somebody constantly logged on to the other computers in order to run using this option.

    If I change the identity option to "This user:" and supply my own username and password, the Standard EXE can no longer correctly access the Locator on the same computer with it, even when I'm the one logged on (and I can't even try connecting to another computer, because my Locator object doesn't have a user interface--I need to get at the Connect function through my standard exe in order to even attempt connecting to the other computer). The error that I'm getting is extremely strange because, apparently, the CreateObject("Locator.Locator") call returns an (apparently) valid ILocator object (and doesn't throw an error), but any attempt to call the functions of the ILocator object causes error 462, "The remote server machine does not exist or is unavailable."

    Does anyone out there have any insight into what I should change in the projects or the DCOM settings to make it possible to run an out-of-process server on several machines, some of which might have different users or not have anyone logged in, and have the processes communicate properly?

    --roo2d2

  2. #2
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: ActiveX server and DCOM

    Search my name and Singleton. Your post is rather long-winded so it's hard to determine exactly what you need but it may help.
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2006
    Posts
    18

    Re: ActiveX server and DCOM

    What I am trying to do is make the ActiveX server do across computers (through DCOM) what it is already doing on one computer.

    It is already a singleton, if I'm understanding the term correctly. I can have several different copies of my standard exe running, and they all connect to the same object. Only one copy of my Locator.exe (the ActiveX server) program is running at any given time, according to Task Manager.

    In fact, it is sort-of working across computers, as long as the same person is logged into both, and the DCOM identity settings are set to "the launching user". While this situation was all right while I was debugging the communication between two copies of the server running on different machines, it is not a good situation for my finished product. I'm asking what I should change to allow different people to be logged on, or for nobody to be logged on, and have the server programs correctly connect to each other. These changes might be in the DCOM settings or I might have to change the ActiveX exe project settings. I'm just not familiar enough with what all the options do to know.

    If you can point me to a particular post that you've made that you think addresses this problem, I'd be extremely happy, because I couldn't find it.

    --roo2d2

  4. #4
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: ActiveX server and DCOM

    I think I see where you are going with this. Maybe I can help by offering my general DCOM settings. These 4 users are required to both Launch, and Access each DCOM component:

    - Everyone
    - Interactive
    - Network
    - System
    - (Anonymous is sometimes required)

    Identity should be the Interactive user

    The Default Properties should be:

    - Connect
    - Identify

    To remove any chance of auth. failures, use:

    - None
    - Anonymous
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jan 2006
    Posts
    18

    Re: ActiveX server and DCOM

    OK, thanks. That works, as long as someone is logged in. They're correctly connecting to each other and communicating. I'm not sure yet how much of hassle it'll be to have to log in to every connected computer to get it to work, so I might need some advice on how to do a remote login later on in the project.

    The weird thing is I thought I tried the above setup last week and it didn't work, but I'm not going to complain because it's working now!

    --roo2d2

  6. #6
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: [RESOLVED] ActiveX server and DCOM

    I recommend using VNC server/viewer to do remote configurations. It will not "log out" the currently logged in user, runs as a service, and it's free. Glad to hear you are up and running.
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width