By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,236 Members | 1,839 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,236 IT Pros & Developers. It's quick & easy.

Unmanaged DLL .NET Access to XML read/write routines

P: n/a
This is a followup to my question in doing unmanaged DLLs in .NET. I
was able to create the DLL and the application was able to see it. So
far so good. Now I need to make that unmanaged DLL read an XML file
which contains a scenario I plan to follow within the library.

Basically this DLL is an interface to a 1553 network with data being
sent and received. By creating an artificial version, I hope to
pretend to send and receive a huge amount of data to stress my
software. But to do this, I need to execute a "scenario" of timed
events. To do that, it seems natural to use the .NET XML processing
code. Trouble is I can't get it to work. I can't even get the Console
writelines to work. Maybe as an unmanaged DLL I can't get to those
functions or maybe I'm just not doing it right.

In this unmanaged DLL, in C++ should I be able to do the following:
#using <mscorlib.dll>
#using <System.Xml.Dll>

using namespace System;
using namespace System::IO;
Console::WriteLine (S"File {0} read sucessfully ...",
args);
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Not sure what you are trying to achieve, this code:
- must be compiled as managed C++
- fails to compile.

Willy.

"Dave Griffin" <ca***********@yahoo.com> wrote in message
news:45**************************@posting.google.c om...
This is a followup to my question in doing unmanaged DLLs in .NET. I
was able to create the DLL and the application was able to see it. So
far so good. Now I need to make that unmanaged DLL read an XML file
which contains a scenario I plan to follow within the library.

Basically this DLL is an interface to a 1553 network with data being
sent and received. By creating an artificial version, I hope to
pretend to send and receive a huge amount of data to stress my
software. But to do this, I need to execute a "scenario" of timed
events. To do that, it seems natural to use the .NET XML processing
code. Trouble is I can't get it to work. I can't even get the Console
writelines to work. Maybe as an unmanaged DLL I can't get to those
functions or maybe I'm just not doing it right.

In this unmanaged DLL, in C++ should I be able to do the following:
#using <mscorlib.dll>
#using <System.Xml.Dll>

using namespace System;
using namespace System::IO;
Console::WriteLine (S"File {0} read sucessfully ...",
args);

Nov 16 '05 #2

P: n/a

Well, my application is built on the foundation of this unmanaged DLL
written
by another company (who won't write a true .NET assembly). I want to
test my
application on a computer which doesn't have the hardware to support the
real library. My thought is to create another version of the library
that looks
identical to that other company's unmanaged DLL to my own application.
If
within that phony version of their library I can pretend to receive
network
traffic and return it as the real library would, then I can exercise my
application even though the computer it's running on doesn't have the
hardware to really run.

So the problem is that the DLL I create has to be unmanaged in order to
be
called like the unmanaged DLL I'm replacing is called, and yet I want to
use
sophisticated services like console writes and XML reads. Perhaps I
should be
just trying to just use standard C writes and file reads (if that
works). The
goal is to feed my C# .NET application data through this unmanaged DLL
interface so that it looks like it's connected to the original unmanaged
DLL
and through it, the network of data.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.