Click here to Skip to main content
14,878,669 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear Friends,
I am working with a .net remoting project. In my soution, i have the following code in three
projects. The problem is, i could not get value of LogInSuccessfull variable.

Public Interface MyInterface
      Sub TryToLogIn(ByVal UserName As String, ByVal UserPassword As String)
      ReadOnly Property LogInSuccessfull() As Boolean
   End Interface

   Imports System.Runtime.Remoting
   Imports ClassInterfaces

   Public Class ZoneLogIn
       Inherits MarshalByRefObject
       Implements ClassInterfaces.MyInterface

        Private mLogInSuccesfull As Boolean

        Public ReadOnly Property LogInSuccessfull() As Boolean Implements ClassInterfaces.MyInterface.LogInSuccessfull
             return mLogInSuccesfull
          End Get
       End Property

       Public Sub TryToLogIn(ByVal UserName As String, ByVal UserPassword As String) Implements  ClassInterfaces.MyInterface.TryToLogIn
         mLogInSuccesfull =true
       End Sub

   End Class

   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       Dim test As ClassInterfaces.MyInterface
       test = CType(Activator.GetObject(GetType(ClassInterfaces.MyInterface), "tcp://"), ClassInterfaces.MyInterface)
       test.TryToLogIn("test", "1234")

   End Sub

Would you help me what i am missing in the above code?
Thanking you in advance.

Sergey Alexandrovich Kryukov 14-Aug-11 16:36pm
What seems to be a problem?
Keith Barrow 15-Aug-11 12:19pm
Are you getting any errors? Whay is not working as expected?
We need more information if we are to help!

1 solution

Are you sure the object is created properly? Can you check if test IsNot Nothing after getting it from the URL?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900