Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public interface class ITest
void Test(String^ greeting);
};

public ref class MarshallableExample : MarshalByRefObject, ITest
public ref class MarshalableExample : MarshalByRefObject, ITest
{
public:
virtual void Test(String^ greeting)
Expand All @@ -20,12 +20,12 @@ void main()
{
// Construct a path to the current assembly.
String^ assemblyPath = Environment::CurrentDirectory + "\\" +
MarshallableExample::typeid->Assembly->GetName()->Name + ".exe";
MarshalableExample::typeid->Assembly->GetName()->Name + ".exe";

AppDomain^ ad = AppDomain::CreateDomain("MyDomain");

System::Runtime::Remoting::ObjectHandle^ oh =
ad->CreateInstanceFrom(assemblyPath, "MarshallableExample");
ad->CreateInstanceFrom(assemblyPath, "MarshalableExample");

Object^ obj = oh->Unwrap();

Expand All @@ -41,7 +41,7 @@ void main()
ITest^ it = (ITest^) obj;
it->Test("Hi");

MarshallableExample^ ex = (MarshallableExample^) obj;
MarshalableExample^ ex = (MarshalableExample^) obj;
ex->Test("Goodbye");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ public interface ITest
void Test(string greeting);
}

public class MarshallableExample : MarshalByRefObject, ITest
public class MarshalableExample : MarshalByRefObject, ITest
{
static void Main()
{
// Construct a path to the current assembly.
string assemblyPath = Environment.CurrentDirectory + "\\" +
typeof(MarshallableExample).Assembly.GetName().Name + ".exe";
typeof(MarshalableExample).Assembly.GetName().Name + ".exe";

AppDomain ad = AppDomain.CreateDomain("MyDomain");

System.Runtime.Remoting.ObjectHandle oh =
ad.CreateInstanceFrom(assemblyPath, "MarshallableExample");
ad.CreateInstanceFrom(assemblyPath, "MarshalableExample");

object obj = oh.Unwrap();

Expand All @@ -33,7 +33,7 @@ static void Main()
ITest it = (ITest) obj;
it.Test("Hi");

MarshallableExample ex = (MarshallableExample) obj;
MarshalableExample ex = (MarshalableExample) obj;
ex.Test("Goodbye");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ Public Interface ITest
Sub Test(ByVal greeting As String)
End Interface

Public Class MarshallableExample
Public Class MarshalableExample
Inherits MarshalByRefObject
Implements ITest

Shared Sub Main()

' Construct a path to the current assembly.
Dim assemblyPath As String = Environment.CurrentDirectory & "\" &
GetType(MarshallableExample).Assembly.GetName().Name & ".exe"
GetType(MarshalableExample).Assembly.GetName().Name & ".exe"

Dim ad As AppDomain = AppDomain.CreateDomain("MyDomain")

Dim oh As System.Runtime.Remoting.ObjectHandle =
ad.CreateInstanceFrom(assemblyPath, "MarshallableExample")
ad.CreateInstanceFrom(assemblyPath, "MarshalableExample")

Dim obj As Object = oh.Unwrap()

Expand All @@ -35,7 +35,7 @@ Public Class MarshallableExample
Dim it As ITest = CType(obj, ITest)
it.Test("Hi")

Dim ex As MarshallableExample = CType(obj, MarshallableExample)
Dim ex As MarshalableExample = CType(obj, MarshalableExample)
ex.Test("Goodbye")
End Sub

Expand Down