I have run into a major problem that I have encountered before and now it
is bigger than ever.  My customer has a load of COM components that take
an MSXML2.IXMLDOMNode as an input parameter.  This is what I did:



Wrap the appropriate msxml3.dll using tlbimp
Wrap their COM component using tlbimp
Write code in C# to create an XMLDOMDocument, load the XML, pass
documentElement to COM interop class.


I get a COM Interop error from their class.  I have the source code for
their class but the line numbers are messed up.  Basically, it looks like
it is getting an error when trying to convert the input pointer to a safe
pointer in C++:

    ATL::CComQIPtr<IXMLDOMNode> tmpConfig;
    tmpConfig = (IUnknown*)reinterpret_cast<IUnknown*>(configuration);

The HResult is 80004003 (-247467261) which is an E_POINTER or Invalid
Pointer.  My guess is that the issue is caused by the fact that I am
marshalling the XML class both IN and OUT (once to create the XML object
in COM and again to pass out to their class).  The ILDASM for the
interface looks like this:


.method public hidebysig newslot virtual abstract
        instance void  Open([in] class [MSXML2]MSXML2.IXMLDOMNode  marshal
( interface) configuration) runtime managed internalcall
{
  .custom instance void [mscorlib]
System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03
00 00 00 00 00 )
} // end of method ICIDCLDevice::Open


I have tried a number of fixes to no avail.  I may have to configure a
custom interface instead of using tlbimp, but this is not clear to me.
Suggestions????


Mario Fulan

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to