How will such a starting point for WPF?
[STAThread]
static void Main()
{
ClientClass remService = new ClientClass();
ObjRef obj = RemotingServices.Marshal(remService,"TcpClient");
// Create apllications MainForm
ClientApp frmMain = new ClientApp();
// provide marshaled object with reference to Application
remService.theMainClient = ( IClientApp) frmMain;
System.Console.WriteLine("Please press ENTER to exit...");
System.Console.ReadLine();
// Application closed...
Application.Run(frmMain);
RemotingServices.Unmarshal(obj);
RemotingServices.Disconnect(remService);
}
In winforms marshalling works correctly, I would like convert it and WPF.
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
static void Main()
{
OperClass remService = new OperClass();
ObjRef obj = RemotingServices.Marshal(remService, "TcpClient");
// Create apllications MainForm
MainWindow frmMain = new MainWindow();
App app = new App();
// provide marshaled object with reference to Application
remService.TheMainOper = (IOperApp)frmMain;
Console.WriteLine("Please press ENTER to exit...");
Console.ReadLine();
// Application closed...
app.InitializeComponent();
app.Run();
RemotingServices.Unmarshal(obj);
RemotingServices.Disconnect(remService);
}
I did so, but I'm not quite sure what is right, because the program works is not entirely correct.
pastebin.com/u/Jinfaa CODE http://screencast-o-matic.com/watch/clniI54tY VIDEO