CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: /clr

  1. #1
    Join Date
    Jul 2000
    Location
    In a flat, Wimbledon, UK
    Posts
    251

    /clr

    Does anyone know how I can set this option in .NET as I'm trying to compile unmanaged code and its not allowing me since I have to set the /CLR option.

    Does anyone know?

    regards

    John

  2. #2
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917
    Did you try "/clr (Common Language Runtime Compilation)" from MSDN (Compiler Options Listed Alphabetically)?
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  3. #3
    Join Date
    Jun 2002
    Posts
    3

    /clr

    From the solutions explorer right click on the project which you want to add the /clr option to and select properties. Under the c++ folder in the properties dialog select command line.
    In the additional options box type "/clr".

    You may have to change a couple of the other compile options as some of the defaults are not compatible with the /clr option.

  4. #4
    Join Date
    Jul 2000
    Location
    In a flat, Wimbledon, UK
    Posts
    251
    Thanks for your reply. another question. If I port my old VC++ code over to .Net with that option does my unmanaged code become mangaed?

    Can I use the .Net environment in the same way that I use VC++ 6 without fear that it's going to change my code?

    Regards

    John

  5. #5
    Join Date
    Jun 2002
    Posts
    3

    /clr

    When you port your project your existing classes do not become managed. To make existing classes managed you have to use the __gc keyword in the class header file, for example:

    __gc class MyClass
    {
    public MyClass();
    etc...
    }

    As far as using VC7, I am sure that your code will not be changed but you may need to change it. I had to give up porting a large MFC app as there were so many compile error regarding Message maps, strings and fstreams. However, i write all my new stuff using VC7 and find it very good.

    Good luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured