G
Guest
This is a combined .NET Remoting & COM interop problem and I don't know which
is the culprit.
I have wrapped a .NET remoting client using the the COM wrapper (regasm,
etc) which fails when the remoting client receives an Interface-type, for
example:
public IMyTask GetRemoteTask()
{
IMyTask myTask;
myTask = (IMyTask) Activator.GetObject(typeof(IMyTask),
"tcp://localhost:8101/MyTask);
}
Calling this GetRemoteTask function from Excel/VBA fails with Error
-2147467262 "No such interface supported". This .NET function is exposed in a
COM dll after running regasm and doing all the other COM wrapper hocus-pocus.
Casting to the class rather than the interface fixes the problem, for example:
public IMyTask GetRemoteTask()
{
IMyTask myTask;
myTask = (MyTask) Activator.GetObject(typeof(MyTask),
"tcp://localhost:8101/MyTask);
}
This isn't the optimal solution because the implemenation now has to be
distributed in addition to the interfaces. I don't want to release or
distribute the implementation DLL which is a big problem.
Another post in dotnet.framework.remoting titled "MarshalByRefObject object
published..." lists exactly the same issue.
is the culprit.
I have wrapped a .NET remoting client using the the COM wrapper (regasm,
etc) which fails when the remoting client receives an Interface-type, for
example:
public IMyTask GetRemoteTask()
{
IMyTask myTask;
myTask = (IMyTask) Activator.GetObject(typeof(IMyTask),
"tcp://localhost:8101/MyTask);
}
Calling this GetRemoteTask function from Excel/VBA fails with Error
-2147467262 "No such interface supported". This .NET function is exposed in a
COM dll after running regasm and doing all the other COM wrapper hocus-pocus.
Casting to the class rather than the interface fixes the problem, for example:
public IMyTask GetRemoteTask()
{
IMyTask myTask;
myTask = (MyTask) Activator.GetObject(typeof(MyTask),
"tcp://localhost:8101/MyTask);
}
This isn't the optimal solution because the implemenation now has to be
distributed in addition to the interfaces. I don't want to release or
distribute the implementation DLL which is a big problem.
Another post in dotnet.framework.remoting titled "MarshalByRefObject object
published..." lists exactly the same issue.