Solved

C++ Unmanaged in VS 2010

Posted on 2011-03-15
8
905 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
ID: 35136560
>>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
ID: 35137839
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
ID: 35138019
>>>"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
ID: 35138258
See attached picture for possibles, you might have even more available (could depend on the version of VS 2010 you have)
0009.jpg
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 44

Expert Comment

by:AndyAinscow
ID: 35138268
>>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
ID: 35138294
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
ID: 35138322
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
ID: 35138358
>>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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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.
A short article about problems I had with the new location API and permissions in Marshmallow
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

914 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

23 Experts available now in Live!

Get 1:1 Help Now