468,512 Members | 1,606 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

Problem referencing Managed class from the Unmanaged one

I have defined a managed class ( __gc ) and a unmanaged ( __nogc ) in a
separate files (but in the same vc++ dotnet project). I have no problem of
referencing the unmanaged class from the menaged one. My problem is that I
cannot reference managed class from the unmanaged.

In my unmanaged class, if I use "using namespace ManagedNamespace;" I get
error C2871: a namespace with this name does not exist. I get the simmilar
error when trying to reference the Managed class directly from the unmanaged
class methods.

If i use "#include ".\ManagedClass.h" I get syntax errors in that header
file (and it was compiling OK before referencing it from the unmanaged
class).

When I copy the unmanaged class to the same file where the managed is,
everything seems ok. Unfortunately, I must keep them separate.

Can anybody help?

Thanks,
Sasha
Nov 17 '05 #1
1 1272
A small repro case would be the fastest way to get a concrete solution to
this.

Thanks.

Ronald Laeremans
Visual C++ team

"Sasha Nikolic" <sa***@dmdsecure.com> wrote in message
news:OD**************@TK2MSFTNGP09.phx.gbl...
I have defined a managed class ( __gc ) and a unmanaged ( __nogc ) in a
separate files (but in the same vc++ dotnet project). I have no problem of
referencing the unmanaged class from the menaged one. My problem is that I
cannot reference managed class from the unmanaged.

In my unmanaged class, if I use "using namespace ManagedNamespace;" I get
error C2871: a namespace with this name does not exist. I get the simmilar
error when trying to reference the Managed class directly from the
unmanaged
class methods.

If i use "#include ".\ManagedClass.h" I get syntax errors in that header
file (and it was compiling OK before referencing it from the unmanaged
class).

When I copy the unmanaged class to the same file where the managed is,
everything seems ok. Unfortunately, I must keep them separate.

Can anybody help?

Thanks,
Sasha

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Chris Kiechel | last post: by
8 posts views Thread by Nadav | last post: by
5 posts views Thread by Ney André de Mello Zunino | last post: by
9 posts views Thread by Amit Dedhia | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.