Declaring a managed class member in an unmanaged class

Posted on 2004-11-10
Last Modified: 2013-12-03

I am new to the Managed C++,I have created a namespace "N" with "Cl" class in that name space.

Now I want to use this "Cl" as a data memeber in an unmanaged C++ class.
The syntax I used in Unmanaged c++ class header is as follows..
class Unmanged
Cl *m_Managed;

The reported error is..
error C3265: cannot declare a managed 'm_Managed' in an unmanaged 'Unmanaged'

Can anyone please let me a way out for this?

Question by:l_madhavi
    1 Comment
    LVL 48

    Accepted Solution

    class Unmanged
        gcroot<Cl*> m_Managed;


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now