Solved

C++ Unmanaged in VS 2010

Posted on 2011-03-15
8
898 Views
Last Modified: 2012-05-11
I've been talking to someone about VS 2010 and we seems to be in a fog and i would like to clarify that.

That person told me that producing C++ code in VS2010 would automatically be managed.  

Can we still produce C++ unmanaged code in VS2010 and how?  
I've seen several C++ projects type but it's not clear for me.

thanks
0
Comment
Question by:cdebel
  • 5
  • 2
8 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
>>That person told me that producing C++ code in VS2010 would automatically be managed.  

Basically - RUBBISH, they don't know what they are talking about OR just misunderstood you.


For an existing project it will be unmanaged unless you deliberately change settings to make it managed.

For a new project just select the options (project template) that don't require managed code
0
 
LVL 10

Author Comment

by:cdebel
Comment Utility
Thx Andy, but could you be more specific?

What kind of project template allow me to start a project for unmanaged code?

What are the settings i must check in the project to make an existing project unmanaged?

thanks
0
 
LVL 12

Assisted Solution

by:trinitrotoluene
trinitrotoluene earned 100 total points
Comment Utility
>>>"ng C++ code in VS2010 would automatically be managed"

this is just not possible.

You need to understand the concepts first. Take a look at this link. It might be a bit old but should give you an idea.
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 400 total points
Comment Utility
See attached picture for possibles, you might have even more available (could depend on the version of VS 2010 you have)
0009.jpg
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
>>What are the settings i must check in the project to make an existing project unmanaged?

If it was unmanaged before conversion to VS2010 format then it is still unmanaged - nothing you need to do.
0
 
LVL 44

Assisted Solution

by:AndyAinscow
AndyAinscow earned 400 total points
Comment Utility
CLR means common runtime support.
If anything is selected then it will be adding support for .NET (=managed) code.
0010.jpg
0
 
LVL 10

Author Comment

by:cdebel
Comment Utility
Thanks for your answer Andy.

@trinitro: thanks for the link, i'll have to read this for sure because i need to understand this subject a lot.  I want to develop some VNC-Like Server application, and i've done some tests yesterday in C# to do some BitBlt.

In my test, i've copied the whole screen, pieces by pieces (10x10 pixels block, i know that it's extreme... usually it would be something more like 50x50 or 100x100).  On my i7-950 with a kick ass graphic card, it took a fraction of second to copy the whole screen (1920x1200 resolution).  On an AMD Phenom II X6 1100T (which is still a pretty good computer), it took over 3 minutes for a smaller resolution.  

So i need to understand if writting some functions in C++ Unmanaged for the core job (to avoid slow pinvokes), mixed with C#, would do the job.
0
 
LVL 44

Assisted Solution

by:AndyAinscow
AndyAinscow earned 400 total points
Comment Utility
>>So i need to understand if writting some functions in C++ Unmanaged for the core job (to avoid slow pinvokes), mixed with C#, would do the job.


Should do - one can call an unmanaged dll from managed code.  One could also do a mixed mode dll (mixes both managed and unmanaged code) in C++.  I think that is referred to as IJY - It Just Works.  Your C# app could then use the C++.net part which talks internally to the unmanaged C++ section.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

771 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

11 Experts available now in Live!

Get 1:1 Help Now