Click here to Skip to main content
15,909,742 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCreating a group box at runtime Pin
MarcoNedwig6-Dec-04 4:18
MarcoNedwig6-Dec-04 4:18 
GeneralRe: Creating a group box at runtime Pin
David Crow6-Dec-04 4:30
David Crow6-Dec-04 4:30 
GeneralCPictureHolder to CBitmap Pin
greekgoddj6-Dec-04 4:13
greekgoddj6-Dec-04 4:13 
GeneralRe: CPictureHolder to CBitmap Pin
PJ Arends6-Dec-04 8:24
professionalPJ Arends6-Dec-04 8:24 
GeneralLoadLibrary("FilePath.dll") Failed - The specified procedure could not ne found Pin
SKPATEL206-Dec-04 3:04
SKPATEL206-Dec-04 3:04 
GeneralRe: LoadLibrary("FilePath.dll") Failed - The specified procedure could not ne found Pin
David Crow6-Dec-04 3:24
David Crow6-Dec-04 3:24 
GeneralRe: LoadLibrary("FilePath.dll") Failed - The specified procedure could not ne found Pin
missdeborah26-Jan-12 12:15
missdeborah26-Jan-12 12:15 
GeneralUnmanaged DLL - Reading an XML File Pin
DavidWGriffin6-Dec-04 2:46
DavidWGriffin6-Dec-04 2:46 
I'm working on a .NET C# application which calls an unmanaged DLL (written in C/C++) which interfaces with a 1553 network to read and send data to a 1553 bus controller. This means that my application is hard to test on my regular desktop since it doesn't have the needed network hardware to actually send or receive data. Furthermore even if it had the hardware, setting up a test with the appropriate network traffic is very difficult (though we do have specialized lab facilities that can do it -- heavily scheduled facilities). My objective is to run complex, challenging, realistic tests of my application on my desktop.

My thought was to create an unmanaged DLL in .NET which could "pretend" to be the network DLL and feed data to my application in the same way the real DLL would. This sounds good in principle but I haven't quite managed it yet. With some help from the internet newsgroup, I managed to create a VC++ unmanaged DLL which when created looks like the network DLL to my application. David Browne on microsoft.public.dotnet.languages.csharp provided the following instructions for me:


Visual Studio > New Project > Visual C++ Projects > Win32 Projects > Win32
Project
Brings up the "Win32 Application Wizard"
Change Application Settings > Application Type
Choose ApplicationType: DLL and Additional Options: Export Symbols

That will create a skeleton of an unmanaged DLL. In the [appname].h file
are the exports for the application, with examples of exporting a class,
variable and a function.

This actually worked great. Now however, what I'm trying to do is to do something useful within that C++ unmanaged library.

There are no doubt many approaches that could be used for this. One might be to have the unmanaged DLL read a file that contains a "scenario" of network messages. Unfortunately, the usual XML processing classes don't seem to be available, probably because they are "managed" and available only through the CLR. The question is what to do about that? I get the hint from reading some of these postings that I might be able to eventually overcome that limitation by creating some C# app doing what I need and calling it from the C++ but that seems complicated. Is there a better way to read this scenario file? Am I better off just reading it as text and doing my own parsing? I'm pretty new to the sophisticated parts of .NET so I thought I'd ask for some advice. Thanks.



David W. Griffin
Lockheed Martin Aeronautics Company
GeneralRe: Unmanaged DLL - Reading an XML File Pin
Steve S6-Dec-04 6:00
Steve S6-Dec-04 6:00 
GeneralRe: Unmanaged DLL - Reading an XML File Pin
Anonymous7-Dec-04 9:35
Anonymous7-Dec-04 9:35 
GeneralRe: Unmanaged DLL - Reading an XML File Pin
DavidWGriffin7-Dec-04 9:36
DavidWGriffin7-Dec-04 9:36 
Generalshortkeys Pin
V.6-Dec-04 2:22
professionalV.6-Dec-04 2:22 
GeneralRe: shortkeys Pin
David Crow6-Dec-04 2:35
David Crow6-Dec-04 2:35 
GeneralRe: shortkeys Pin
V.6-Dec-04 2:41
professionalV.6-Dec-04 2:41 
GeneralRe: shortkeys Pin
BlackDice6-Dec-04 2:47
BlackDice6-Dec-04 2:47 
GeneralRe: shortkeys Pin
V.6-Dec-04 3:28
professionalV.6-Dec-04 3:28 
GeneralRe: shortkeys Pin
V.6-Dec-04 3:29
professionalV.6-Dec-04 3:29 
GeneralCustom control in VC++ Pin
johnny__XP6-Dec-04 2:17
johnny__XP6-Dec-04 2:17 
GeneralProgram wont write to file Pin
CNewbie6-Dec-04 0:43
CNewbie6-Dec-04 0:43 
GeneralRe: Program wont write to file Pin
Sujan Christo6-Dec-04 1:54
Sujan Christo6-Dec-04 1:54 
GeneralRe: Program wont write to file Pin
CNewbie6-Dec-04 7:42
CNewbie6-Dec-04 7:42 
GeneralRe: Program wont write to file Pin
David Crow6-Dec-04 2:30
David Crow6-Dec-04 2:30 
Generalline numbers in an editor application Pin
SVPG6-Dec-04 0:40
SVPG6-Dec-04 0:40 
Generaltransmitfile Pin
yingkou6-Dec-04 0:06
yingkou6-Dec-04 0:06 
GeneralRe: transmitfile Pin
David Crow6-Dec-04 2:33
David Crow6-Dec-04 2:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.