Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetInterface() woes, part deux
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
GetInterface() woes, part deux
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01029734
Message ID:
01029734
Vues:
56
I am trying to implement something very similar to a sample program Calvin Hsia created in MSDN to handle a "Callback" from a COM (http://msdn.microsoft.com/library/en-us/dnfoxgen7/html/vfpandcom.asp?frame=true#vfpandcom_topic10). The main difference is that I want to setup an indefinite number of "Callbacks" from different workstations and users, kind of an Observer pattern. Now, as I posted before, everything works fine if everything runs under the same user, I can run this from any computer and will run as I want. The problem lies that if it is another user that wants to "subscribe", then the call to GETINTERFACE fails.

Let me try to put it in a graph:
[Computer 1 User 1]  [Computer 2 User 1]  [Computer 3 User 2]
|                 |  |                 |  |                 |
|   COM Server    |  |    CLIENT 1     |  |    CLIENT 2     |
|_________________|  |_________________|  |_________________|
Now, for simplicity, let's say "COM Server" Only accepts one client simultaneously, so it would be like Calvin's sample program and it will have, somewhere:


Function Attach(toObserver)

this.Observer = getinterface(toObserver, 'Interface', 'myDLL.DLL')

Now the 'Interface' is, let's say, just one method, called 'Updated'
And somewhere when an event happens, we call the Observers updated method:

this.Observer.Updated()

And Client will have something like

loObserver = createobject('Some class that implements "Interface" from "myDLL.DLL")
loServer.AttachClient(loObserver)


Now, if the scenario is:
[Computer 1 User 1]  [Computer 2 User 1]
|                 |  |                 |
|   COM Server    |  |    CLIENT 1     |
|_________________|  |_________________|
Everything works fine and I am happy, I can even add more clients and all will work, from any computer as long as the user is "User 1", but with
[Computer 1 User 1]  [Computer 3 User 2]
|                 |  |                 |
|   COM Server    |  |    CLIENT 1     |
|_________________|  |_________________|
Then the call to GETINTERFACE() from "computer 3/User 2" fails with an Access Denied error, my guess is that it fails for toObserver is an object created by User 2, while the server itself is running under a different user, but I tried giving all kinds of permissions everywhere, in DCOM, in COM+, also all users are administrators of the machine that runs the Server, but nothing seems to work.

Any ideas?
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform