Disinheriting(?) / overriding .ToString to access COM Object .toString
Question
I have a java library that I am accessing in VB.NET via COM. The objects on the java side expose non-trivial .toString methods that I need for debugging. Unfortunately, when I call .toString on the COM objects, the call is being intercepted by the Object class' .ToString function.
How do I force the call to the COM-side .toString and prevent Object.ToString from firing?
Solution
Do you have access to the IDL for the java object? Are you generating the runtime callable wrapper for the COM object?
I think you should change the interop assembly or manually generate the wrapper to change the toString() method to toStringJava() or to_String() or something else that doesn't clash with the syntax for object.ToString(). Here's a starting point on MSDN for customizing runtime callable wrappers.