using .NET Remoting in Excel
i have a problem ini my application. i want to call methods from .NET Remoting object from my Excel Application (VBA).
the structur of my codes are:
//Located in server (using C#)
classs ObjectEntryPoint : IObjectEntryPoint
{
// Codes here..
}
//Located in server & client
Interface IObjectEntryPoint
{
// Codes here...
}
//Located in server (using C#)
classs MyRemotingObject : IMyRemotingObject
{
// Codes here..
}
// I want to create the instance of MyRemotingObject from client through
// this interface. (using C#)
// Located in server & client
Interface IMyRemotingObject
{
// Codes here...
}
// Interface to be exposed to excel (using VB.net)
interface ILib
Sub Test()
end interface
// class to be exposed to excel (using VB.NET)
class Lib
Implements ILib
private Obj as IMyRemotingObject
public sub Test() Implements ILib.Test
dim OEP as IObjectEntryPoint =
Activator.GetObject(GetType(IObjectEntryPoint),
"tcp://localhost:8080/ObjectEntryPoint")
// =============================================
// ERROR OCCURED HERE: Return argument has an invalid type.
// =============================================
Obj = OEP.GetMyRemotingObject()
end sub
end class
the problem is, when i call Test() method from class Lib from VBA,
there is an error like in the code structure above.
but there is no problem when i call the function from windows form application.
can anyone help me with the solution?
tx

