I am a C# developer.? ? I have determine (maybe wrong) that Microsoft has a bug in their primary interop assembly [login to view URL] (usually found in GAC).? Let me start with the way things work in C++:
There is a method i need access to contained in an interface called IDisplayService and its called TransformRect.? It simply transforms a rectangle from client coordinates to screen coordinates.?
Unfortunately, i have concluded that it is inaccessible from .NET because the [login to view URL] assembly contains a definition of the interface but does not have any implementors... that right? its an orphaned interface with no implementations.? Its supposed to be implemented by HTMLDocument2Class, but its not.? ? This seems to be an oversight, but its killing me.? ?
I understand the the [login to view URL] assembly is just an interop assembly that exposes the actual implementation of mshtml that is offered by the IE browser.? ? I have seen many examples (on the web) where C++ developers use it with good result.? But all references to C# attempts have failed.
So I propose this project:
Build a C++ class (DLL) which makes the call for me and provide the appropriate interop stuff (DllImports) so that it can be called from .NET 2.0 can C#.
using mstml;
public static? class MSAAInteropFix
{
? // this is the reference to your C++ dll - if needed?
? ? ? ? [DllImport("[login to view URL]")]
? ? ? ? public static extern int YourCPPFunction(...);
?
// This is the method i will be calling - using mshtl types
// expected by actual implementation?
? ? ? ? public static void TransformRect(ref tagRECT pRect, _COORD_SYSTEM source, _COORD_SYSTEM destination, IHTMLElement element)
? ? ? ? {
? ? ? ? ? ? ? ? // your implementation here
? ? ? ? }
}
I am open to other solutions.? This is just my attempt at describing the problem by a strawman of the solution.? My main goal of this project is to be able to call that mshtml IDisplayServices interface on HTMLDocument2 but it seems? impossible in C#