Return XmlDocument using C# interop

  • Thread starter Thread starter Bart Roozendaal
  • Start date Start date
B

Bart Roozendaal

Hi,

I have setup a (my first) C# assembly. I am using the COM Interop services
to use the assembly from a Delphi program.

Is there a way to return a XmlDomDocument object from the assembly to the
Delphi program? If I try to return the XmlDocument object itself, I get an
error like:

This type has a ComVisible(false) parent in its hierarchy.

I've now chosen to return the OuterXml of the document and restoring the
object in the Delphi-program, but that seems like one step too many and costs
additional resources and processing time.

Is there some way to pass the XmlDocument to the Delphi program?

Please be aware: these are my first steps into C# and .NET so please forgive
me if it's a stupid question :-)

Bye,
Bart Roozendaa
 
Bart,

If the XmlDocument is not labeled for COM interop, then you won't be
able to pass that object. Since it is not your object, you can't change the
definition either.

You might want to use MSXML in your objects, and expose that, since it
is a COM object. Then, you could pass it to your Delphi program, which can
use the MSXML parser that you are exposing.

Hope this helps.
 
Back
Top