473,320 Members | 2,164 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

using unmanaged namespace in managed code

Hi,

I'm trying to wrap my unmanaged c++ code into a managed c++ wrapper.
The problem is VC .NET doesn't seem to find the namespaces defined in
my unmanaged code. Let's say I have a file "server.h" with a namespace
server. When I include this file in another file that will be compiled
as managed, the compiler gives me the following error:

C2871: 'server' : a namespace with this name does not exist

How can I use unmanaged namespaces in my managed code?

Thx in advance,

RaKKeR

Nov 17 '05 #1
1 2235
///// unmanaged.h
namespace Unmanaged
{

class A
{
};

}

// managed.h
#include "unmanaged.h"
namespace Managed
{

ref class B
{
Unmanaged::A* a;
};

}

You should be able to wrap unmanaged code into a managed class, and use
unmanaged namespaces too.

Tom

RaKKeR wrote:
Hi,

I'm trying to wrap my unmanaged c++ code into a managed c++ wrapper.
The problem is VC .NET doesn't seem to find the namespaces defined in
my unmanaged code. Let's say I have a file "server.h" with a namespace
server. When I include this file in another file that will be compiled
as managed, the compiler gives me the following error:

C2871: 'server' : a namespace with this name does not exist

How can I use unmanaged namespaces in my managed code?

Thx in advance,

RaKKeR

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: mirek | last post by:
Hi, I've got problem building managed class library to wrap unmanaged code. I created managed class library using standard patten: #include "../Unmanaged/Class1.h" //Class1 unmanaged ...
8
by: Burt | last post by:
I am new to VC++ and .NET, so this is a pretty basic question... I want to use OpenFileDialog. Where is the header for it? And in general, how do I find the right header to include in cases...
5
by: CharlesHenri | last post by:
Hello, i plan to use a managed dll containing WinForm classes in an unmanaged win32 exe. Starting from NOTHING, how do i have to proceed ? I have found the following tutorial on...
1
by: slugster | last post by:
Hi, i originally posted this via another portal, but after giving it time to propagate it still hasn't shown up. My apologies for the multiposting. This might be a very simple question, but i...
3
by: Thorsten | last post by:
HI I'm a C# developer and unfortunately I have to write now some code in managed and unmanaged C++. In this area I'm Newbie and therefore please forgive me if this is a really simple...
12
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. ...
6
by: Rich | last post by:
Yes, I'm a noob with .NET looking for help. My goal is to eventually write a managed DLL in C++ that is a wrapper for an unmanaged C DLL, then use the managed DLL in C#, VB, etc. Initially, I...
12
by: DaTurk | last post by:
Hi, I have a rather interesting problem. I have a unmanged c++ class which needs to communicate information to managed c++ via callbacks, with a layer of c# on top of the managed c++ ultimatley...
9
by: =?Utf-8?B?RWR3YXJkUw==?= | last post by:
I would greatly appreciate some help on passing managed object into unmanaged code. I need to pass a reference (address of) of a managed class into unmanaged code (written by a thrid party). The...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.