473,587 Members | 2,316 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(fals e) 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 3255
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.co m

"Bart Roozendaal" <ba************ *@sevensteps.nl > wrote in message
news:6d******** *************** **@news.microso ft.com...
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(fals e) 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
1935
by: Tom Leylan | last post by:
(I posted this in languages.vb also... I can't figure out where things go if you use a little of a lot of things) Hi all... I'm looking for an example (or a pointer to one) related to the following. I have a WebService (it works) that fetches data, turns it into XML and returns it to a vb.net client. The "data" though represents property...
1
17120
by: Martin Honnen | last post by:
With both .NET 1.0 and 1.1 I have found the following strange behaviour where System.Xml.XmlDocument.LoadXml doesn't throw an error when parsing a text node with a character reference to an invalid characters like &#x1;. Using the CreateTextNode method I create a text node containing "\u0001a" (C# string literal notation). As far as I...
2
1156
by: Shailendra Batham | last post by:
hi gurus I have a asp.net web services and in that i have a function which returns XmlDocument as the return value, when I test the service it works fine and I can see the XML. When I try to call the XML from asp.net, it does not return XmlDocument and gives me this message Cannot implicitly convert type 'System.Xml.XmlNode' to...
2
14318
by: Richard A. Wells | last post by:
All I wanted to do was implement a web service where I'd receive an XML document and return one in response. I'd already figured out how to use XmlReader and XmlWriter classes to do the XML work I need to do. And all that fancy ASP.NET serialization really got in my way. Reading articles by Yasser Shohoud, Tim Ewald, and Matt Powell led me...
1
20921
by: R.A. | last post by:
Hi, I have an web service method that accept an xml document and returns a different xml document. Based on the input xml I fill a dataset with information from a database. If the dataset has rows then I need to return those rows to the consumer. I can't tell if the consumer of the web service will use .Net or maybe java. 1) If the web...
10
19127
by: Mark Jerde | last post by:
I'm trying to learn the very basics of using an unmanaged C++ DLL from C#. This morning I thought I was getting somewhere, successfully getting back the correct answers to a C++ " int SumArray(int ray, int count)" Now I'm having problems with C++ "return(false)" being True in C#. Here is the C# code. ========================= using...
1
1694
by: shapper | last post by:
Hello, For the past hours I have been trying to solve a problem which is driving me crazy. I have to different codes where the problem to solve is the same: CODE 1 (Transforms a XML document using a XSL file): Function Trans()
10
2145
by: Atara | last post by:
Suppose I have the following functions: Public Function myF1ToStream(...) As System.IO.MemoryStream . . . Dim ms As New System.IO.MemoryStream(buf) Return ms End Function Public Function mcF2ToXml(. . .) As Xml.XmlDocument . . .
11
2874
by: casucci | last post by:
I do a return as XMLDataDocument in my webservice but it returns not with the namespaces etc in them. Anyone have and example where I can have the webservice return it as a XML. C# preferred. Flash just sees it as an object when it calls the web service. Thanks
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.