argument type System.MarshalByRefObject cannot be converted exceop -
09-12-2006
, 08:04 AM
Hello
I'm having a problem in my remoting application (client part). This is the
exception I get "The argument type System.MarshalByRefObject cannot be
converted into parameter type Interfaces.IClientSessie."
The exception happens on balie.login(...
banksessie1.ClientSessie seems to be the problem removing this part solves
the exception. I can't seem to find the problem. Anyone any insights or at
least some more information about this error?
(part of) Button click
try
{
int nummertje;
string text;
BankSessie banksessie1 = new BankSessie(this.balie);
string text2 = this.balie.logIn(this.textBoxNaam.Text,
this.textBoxWachtwoord.Text, banksessie1.ClientSessie, out nummertje, out
text);
if (text2 != null)
{
banksessie1.Nr = nummertje;
banksessie1.Naam = text;
banksessie1.Sessie = text2;
banksessie1.stopped += new BankSessieStopped(this.bs_stopped);
base.Hide();
banksessie1.Show();
}
else
{
this.richTextBoxMededeling.Text = "Inloggen is mislukt";
}
}
catch ()
{
this.richTextBoxMededeling.Text = "Connectie niet in orde\nProbeer opnieuw
verbinding te maken";
}
-------------------------
public interface IBalie
{
// Methods
string logIn(string accountnaam, string wachtwoord, IClientSessie
saldoUpdate, out int nr, out string naam_plaats);
void logUit(string sessieId, IClientSessie saldoUpdate);
bool maakOver(string sessieId, int bron, int bestemming, Money bedrag);
string openRekening(string naam, string plaats, string wachtwoord);
bool valid();
}
------------------------------
public class IClientSessie : MarshalByRefObject
{
// Methods
public override object InitializeLifetimeService()
{
return null;
}
[OneWay]
public virtual void RekeningSaldoChanged(int rekening, string saldo)
{
}
}
-------------------------------
private class ClientSessieListner : IClientSessie
{
// Methods
public ClientSessieListner(BankSessie sessie)
{
this.sessie = sessie;
}
public override void RekeningSaldoChanged(int rekening, string saldo)
{
this.sessie.SaldoUpdate(rekening, saldo);
}
// Fields
private BankSessie sessie;
}
------------------------
This is everything I think that’s has some relevance to the problem, if you
need anymore please let me know. |