Ken Kolda
7/30/2004 8:51:00 PM
See comments inline below...
> I've learned the hard way, that you can have as many remote objects as you
> want in .NET
> ...you just need to remember that you can call ONE and only ONE of them if
> you want things
> to work.
This is certainly not true -- I think you'll find lots of people on this
newsgroup who have apps that remote many objects concurrently (or interact
with many remoted objects) without any problems.
>
> Why? Because .NET is smart enough to be able to take two unique URI
strings
> and then, based on the 1st few characters, insure that they are to be
> treated as being the same object
> when registering the object. This insures that when registration occurs,
> .NET will trigger an exception
> due to the duplicate name.
Can you show a very brief code example that causes this exception? What
you're saying above doesn't make any sense to me -- are you sure your code
isn't calling the same registration function twice with the same object
and/or URI?
>
> Sunny has suggested having a Event Wrapper Class, which is fine except
that
> that would violate
> the rule above, since I would need to send both the class I have now and
the
> wrapper....
>
> Due to the rule above, I've combined the functionality of the client and
the
> server into one object.
>
> Basically I follow a scheme of setting a property, which then performs a
> callback using a delegate.
>
> I'm having trouble registering the routine that will be called. The
syntax
> on the "CLIENT" side of
> things is using the following syntax:
> this.RemoteObject.ExecCmdByClient+=new ProcessIt(ClientServer_ExecCmd);
>
You should use normal syntax for hooking up the event, just as you've done.
When you say "I'm having trouble", can you be more specific? Do you get a
compile error, runtime error, it just doesn't work, ...
Ken