HI can anybody help me to solve the problm, it will be a great helpfull. I am using remoting and i wants to raise an event in client from server. here s the code SERVER using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; namespace UpdTrackSrvr { public class Server { public Server() { } public static void Main(string [] args) { //select channel to communicate BinaryServerFormatterSinkProvider oSrvrProv = new BinaryServerFormatterSinkProvider(); oSrvrProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full; BinaryClientFormatterSinkProvider oClProv = new BinaryClientFormatterSinkProvider(); IDictionary Dict = new Hashtable(); Dict["port"] = 8085; TcpChannel chnChanl = new TcpChannel(Dict, oClProv, oSrvrProv); ChannelServices.RegisterChannel(chnChanl); UpdTrig oUpdTrig = new UpdTrig(); RemotingConfiguration.RegisterWellKnownServiceType(oUpdTrig.GetType(), "UpdTrackSrvr", WellKnownObjectMode.Singleton); System.Windows.Forms.MessageBox.Show("Server Activated"); } } } UpdTrig using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; namespace UpdTrackSrvr { public delegate void del_ev(); public class UpdTrig : MarshalByRefObject { public event del_ev UpdEvt; public UpdTrig() { } public String ReplyMessage(String msg) { System.Windows.Forms.MessageBox.Show("Client : "+ msg); return "Server : s! I'm here"; } public void RaiseEvent() { UpdEvt(); } } } CLIENT using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; namespace UpdTrackClnt { public sealed class Loader { public static void Main(string [] args) { new Client().RaiseRemoteEvent(); } } public class Client : MarshalByRefObject { private UpdTrackSrvr.UpdTrig oUpdTrig; public override object InitializeLifetimeService() { return null; } public Client() { TcpChannel chan = new TcpChannel(); ChannelServices.RegisterChannel(chan); oUpdTrig = (UpdTrackSrvr.UpdTrig) Activator.GetObject( typeof(UpdTrackSrvr.UpdTrig), "tcp://localhost:8085/UpdTrackSrvr"); // oUpdTrig.ReplyMessage("Hello?"); oUpdTrig.UpdEvt += new UpdTrackSrvr.del_ev(oUpdTrig_UpdE
panalprasad
Posts
-
Cannot find the assembly, error on events - remoting -
SQL 2000 View ProblemHi using SQL 2000 i created a table (let - TA) and its view (sel * from TA) as VA after creating the view, i added one column to TA but the view is not showing it. the view must have to rebuild, in sysColumns it doesn't shown the new col name in view. any easy method there have innorder to rebuild it. Thanks in advance panal
-
Access97 connectionI am using OleDBConnection to connect Access97 file. While connecting using wizard and clicking on testconnection button it shows an error "MSysAccounts table cannot open" How can i connect to Access97 by OleDbConnection Thanks In advance Panal
-
Multiple InheritanceBut C++ is doing it all well panal
-
Multiple Inheritanceif any body tell me the core idea then its very thankfull question is why c# not support multiple inheritance with class Thanks in adv panal
-
Accessing Multiple form. ASPHi I have two forms in single asp page, how can i access these forms from asp Ex
How can i get cCode & cName from this. Thanks in advance Panal
-
clearing browser historycan any body tell me how to clear client browser's history by javascript Thanks in advance panal
-
Creating inherited web formHi How can i create a webform inherited from another webform (all the controls in the base forms should display in the inherited form) Thanks in advance
-
which O.S. is runningPlease follow the link http://www.developerfusion.co.uk/show/1643/[^]
-
creating an object of a form at runtime using its name as stringThe obj variable is needed for seting the form object. and the name of the form is p_sformname. so if p_sformname="Form1" then obj will assaign an object of Form1
-
Form positionPlease the move function
-
creating an object of a form at runtime using its name as stringHi There is a form named "Form1" and a function for creating its object. the form name is passed to the function and creates an object public function CreateObj(p_sformName as string) as object dim obj as object ' create the object of a form. The form's name is passed from the calling place set obj = new p_sformname end sub Is it possible Thank you in advance Panal prasad