473,661 Members | 2,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unmanaged DLL .NET Access to XML read/write routines

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::WriteL ine (S"File {0} read sucessfully ...",
args);
Nov 16 '05 #1
2 3571
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.goo gle.com...
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::WriteL ine (S"File {0} read sucessfully ...",
args);

Nov 16 '05 #2

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
8850
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I want my users to be able to select a report, click on a command button on a form, which will then automatically create the report as a pdf file and save it to the user's machine. I am using Adobe Acrobat (5.0 I think) and have Adobe Distiller as a
11
6586
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
8
2764
by: Don | last post by:
I have a third party C++ DLL that I am trying to use from C#. The specific function I am trying to use is declared in C++ as follows: ladybugConvertToMultipleBGRU32( LadybugContext context, const LadybugImage* pimage, unsigned char* arpszDestBuffers, LadybugImageInfo* pImageInfo );
2
1796
by: Ken Allen | last post by:
I have a managed .Net assembly (C#) that invokes code in an unmanaged DLL written in C++ 6 via an unsafe assembly that invokes the C++ routines and marshals the data. The interface is not working properly. Is there a way to have the C++ 6 debugger running on the unmanaged DLL when it is invoked from the .Net debugger? I cannot step into the DLL, but can I access it via a separate debugger? Or am I left with instrumentation as the only...
0
964
by: Kristof Thys via .NET 247 | last post by:
Hello, I've been struggling for weeks with this problem, I hope I find some help here... To start, in our company, we have a large existing c++ project (native code, unmanaged c++) The objective is to write a webservice for some of the functionalities from this project. The best way to do this in Visual Studio .NET 2003 seems to me by creating an ASP.NET Web service in c++. I create the default template, wich works just fine. Now I...
7
1735
by: Kristof Thys via .NET 247 | last post by:
Post a new message to microsoft.public.dotnet.languages.vc http://www.dotnet247.com/247reference/default.aspx Hello, I've been struggling for weeks with this problem, I hope I find some help here...
0
3931
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen. It is almost like it is trying to implement it's own COM interfaces... below is the header, and a link to the dll+code: Zip file with header, example, and DLL:...
12
1622
by: doug | last post by:
I understand the basics of what managed code offers and that you open yourself up to security issues if you allow unmanaged code. We already have a decent amount of VB6 code to include COM DLLs. If we put wrappers around some of our code or leave some "asis" what makes our existing production code 'evil' just because it is now considered 'unmanaged'? It may seem like a simple niave question, but the definitions for managed and...
5
4777
by: R. MacDonald | last post by:
Hello, all, I am currently working on a .Net (VB) application that invokes routines in unmanaged (Fortran) DLLs. The unmanaged routines then communicate with the .Net application by means of a call-back mechanism. These calls pass a string that contains a "command" and a pointer to a SafeArray that (depending on the command) either receives data from the ..Net application or provides data to the .Net application. This mechanism is...
0
8432
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8343
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6185
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5653
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.