473,508 Members | 2,250 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Raise a UI (like GotFocus) event back to remoting client

I am writing an app that needs to contain an object model that allows it to
be controlled similiar to something like Word. However, I am writing this in
C# and all managed code. I know that I can use remoting to talk to the UI
components but I need an example of how to create an event when something
happens on the UI (e.g. text box receives focus) and fire that via my object
model back to any remote client.

I also need the ability to create one central Application object that all
remoting clients would use.

Any ideas or sample code on how to do these things?

Thanks
Mark

Nov 16 '05 #1
5 2124
Mark,

I think that having the central application listen on the events of all
the clients is a bad idea. Rather, it would be cleaner if you just exposed
methods on the central application that are called when the events on the
client are fired, and then have the event handlers on the client call the
events on the central application through remoting.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Mark Overstreet" <Ma************@discussions.microsoft.com> wrote in
message news:52**********************************@microsof t.com...
I am writing an app that needs to contain an object model that allows it to
be controlled similiar to something like Word. However, I am writing this
in
C# and all managed code. I know that I can use remoting to talk to the UI
components but I need an example of how to create an event when something
happens on the UI (e.g. text box receives focus) and fire that via my
object
model back to any remote client.

I also need the ability to create one central Application object that all
remoting clients would use.

Any ideas or sample code on how to do these things?

Thanks
Mark

Nov 16 '05 #2
I think there was some confusion...the main application will raise events to
each remote client. Think about a VB6 client app automating Word. Word can
fire events back to that application and this is what I am trying to design
using Remoting and C#. If I the concept of ActiveX exe had been supported in
C#/.NET I don't think that I would be needing any help.

Thanks.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Mark,

I think that having the central application listen on the events of all
the clients is a bad idea. Rather, it would be cleaner if you just exposed
methods on the central application that are called when the events on the
client are fired, and then have the event handlers on the client call the
events on the central application through remoting.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Mark Overstreet" <Ma************@discussions.microsoft.com> wrote in
message news:52**********************************@microsof t.com...
I am writing an app that needs to contain an object model that allows it to
be controlled similiar to something like Word. However, I am writing this
in
C# and all managed code. I know that I can use remoting to talk to the UI
components but I need an example of how to create an event when something
happens on the UI (e.g. text box receives focus) and fire that via my
object
model back to any remote client.

I also need the ability to create one central Application object that all
remoting clients would use.

Any ideas or sample code on how to do these things?

Thanks
Mark


Nov 16 '05 #3
I think there is some confusion...I want to raise events from the main
application back to all remoting clients. Think of a vb6 application
controlling Word through automation. Word can raise events back to the vb6
client and this is what I am trying to emulate with C# and .NET. If .NET had
supported something equivalent to ActiveX Exes I don't think I would have
this problem.

Thanks
Mark

"Nicholas Paldino [.NET/C# MVP]" wrote:
Mark,

I think that having the central application listen on the events of all
the clients is a bad idea. Rather, it would be cleaner if you just exposed
methods on the central application that are called when the events on the
client are fired, and then have the event handlers on the client call the
events on the central application through remoting.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Mark Overstreet" <Ma************@discussions.microsoft.com> wrote in
message news:52**********************************@microsof t.com...
I am writing an app that needs to contain an object model that allows it to
be controlled similiar to something like Word. However, I am writing this
in
C# and all managed code. I know that I can use remoting to talk to the UI
components but I need an example of how to create an event when something
happens on the UI (e.g. text box receives focus) and fire that via my
object
model back to any remote client.

I also need the ability to create one central Application object that all
remoting clients would use.

Any ideas or sample code on how to do these things?

Thanks
Mark


Nov 16 '05 #4
Mark,

Generally, over remoting, I think events are a bad idea. The reason for
this is that the thing firing the event has to have type information about
the types that the methods are attached to.

For what you want to do, I would create an interface which has the
callback methods on that. Then, implement that interface on an object which
has events that are fired when the methods on the interface implementation
are fired. The object also has to derive from MarshalByRefObject. Finally,
house this object in a separate assembly, so that the client and main app
can share it.

Then, from your clients, have then attach their event handlers to the
shim, and then pass the shim to your main application, which accepts the
interface (this way, it marshals calls back to the interface implementation,
and it has all the type information it needs).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Mark Overstreet" <Ma************@discussions.microsoft.com> wrote in
message news:FF**********************************@microsof t.com...
I think there was some confusion...the main application will raise events
to
each remote client. Think about a VB6 client app automating Word. Word
can
fire events back to that application and this is what I am trying to
design
using Remoting and C#. If I the concept of ActiveX exe had been supported
in
C#/.NET I don't think that I would be needing any help.

Thanks.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Mark,

I think that having the central application listen on the events of
all
the clients is a bad idea. Rather, it would be cleaner if you just
exposed
methods on the central application that are called when the events on the
client are fired, and then have the event handlers on the client call the
events on the central application through remoting.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Mark Overstreet" <Ma************@discussions.microsoft.com> wrote in
message news:52**********************************@microsof t.com...
>I am writing an app that needs to contain an object model that allows it
>to
> be controlled similiar to something like Word. However, I am writing
> this
> in
> C# and all managed code. I know that I can use remoting to talk to the
> UI
> components but I need an example of how to create an event when
> something
> happens on the UI (e.g. text box receives focus) and fire that via my
> object
> model back to any remote client.
>
> I also need the ability to create one central Application object that
> all
> remoting clients would use.
>
> Any ideas or sample code on how to do these things?
>
> Thanks
> Mark
>


Nov 16 '05 #5
Thanks that makes sense and I'll give it a shot. However, I don't like that
because it is more work for anyone trying to automate my application. Any
chance that the new version of .NET will support events better?

Thanks.
"Nicholas Paldino [.NET/C# MVP]" wrote:
Mark,

Generally, over remoting, I think events are a bad idea. The reason for
this is that the thing firing the event has to have type information about
the types that the methods are attached to.

For what you want to do, I would create an interface which has the
callback methods on that. Then, implement that interface on an object which
has events that are fired when the methods on the interface implementation
are fired. The object also has to derive from MarshalByRefObject. Finally,
house this object in a separate assembly, so that the client and main app
can share it.

Then, from your clients, have then attach their event handlers to the
shim, and then pass the shim to your main application, which accepts the
interface (this way, it marshals calls back to the interface implementation,
and it has all the type information it needs).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Mark Overstreet" <Ma************@discussions.microsoft.com> wrote in
message news:FF**********************************@microsof t.com...
I think there was some confusion...the main application will raise events
to
each remote client. Think about a VB6 client app automating Word. Word
can
fire events back to that application and this is what I am trying to
design
using Remoting and C#. If I the concept of ActiveX exe had been supported
in
C#/.NET I don't think that I would be needing any help.

Thanks.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Mark,

I think that having the central application listen on the events of
all
the clients is a bad idea. Rather, it would be cleaner if you just
exposed
methods on the central application that are called when the events on the
client are fired, and then have the event handlers on the client call the
events on the central application through remoting.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Mark Overstreet" <Ma************@discussions.microsoft.com> wrote in
message news:52**********************************@microsof t.com...
>I am writing an app that needs to contain an object model that allows it
>to
> be controlled similiar to something like Word. However, I am writing
> this
> in
> C# and all managed code. I know that I can use remoting to talk to the
> UI
> components but I need an example of how to create an event when
> something
> happens on the UI (e.g. text box receives focus) and fire that via my
> object
> model back to any remote client.
>
> I also need the ability to create one central Application object that
> all
> remoting clients would use.
>
> Any ideas or sample code on how to do these things?
>
> Thanks
> Mark
>


Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4205
by: lauren quantrell | last post by:
I have a combo box on a form. It uses the GotFocus event to poopulate the rowsource with a value list that is created on the fly in VBA. Fine and dandy, except, is a user opens another form and...
1
10495
by: Dan Cimpoiesu | last post by:
I have a remoting object, derived from MarshalByRefComponent, that I instantiate on the client side, with Activator.GetObject. Can I receive events fired on the server, on the client? How?
1
1801
by: Sanjit Suchak | last post by:
Hi, I am just learning about .net remoting and have managed to get it working. However, I now want to write a basic chat program. The problem I've got is getting the server to only fire...
1
1582
by: zorhel | last post by:
Hi. How can I raise an event in a specific client, or in all clients, not using thread, in a web application using asp.net? The .net remoting works in this case? How? I can't understand yet!...
1
2138
by: Anthony | last post by:
i'm a newbie to .net remoting. I want to broadcast server event to client using .net remoting. I tried a few samples but they works only on Same machine or Lan environment. - Is there any...
1
2117
by: John Dann | last post by:
VB.Net 2005: I have a class that performs some functions and then needs to update some labels on the main form (from which it is called) with several pieces of information, some text, some...
0
1585
by: erbilkonuk | last post by:
Hi, I am very new to .NET Remoting and I try to run a simple program to subscribe to an event raised by Remoting Class. The Remoting Server initiates an instance of Remoting Class as Singleton /...
2
3041
by: erbilkonuk | last post by:
Hi, I am very new to .NET Remoting and I try to run a simple program to subscribe to an event raised by Remoting Class. The Remoting Server initiates an instance of Remoting Class as Singleton /...
2
3498
by: =?Utf-8?B?ZmFpcnl2b2ljZQ==?= | last post by:
in a remoting application, i set a event in the host, and let the client to book it, and in the host side i set the TypeFilterLevel to Full and open the callback port in the client side, but told...
0
7227
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7127
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7331
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5633
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.