470,602 Members | 1,731 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,602 developers. It's quick & easy.

Return XmlDocument using C# interop

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 Roozendaal
Apr 30 '06 #1
1 3094
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bart Roozendaal" <ba*************@sevensteps.nl> wrote in message
news:6d*************************@news.microsoft.co m...
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 Roozendaal

May 1 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Tom Leylan | last post: by
1 post views Thread by Martin Honnen | last post: by
2 posts views Thread by Shailendra Batham | last post: by
2 posts views Thread by Richard A. Wells | last post: by
10 posts views Thread by Mark Jerde | last post: by
1 post views Thread by shapper | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.