473,386 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

managed type Mixed (/clr) or Pure (/clr:pure)

Hi,

What is the benefit of using the Pure option over the Mixed one. Is there a
better performance?

We have a lot of stuff in c++ with mfc support en we want to use in our .net
apps. With mixed setting we can compile including the mfc part of our code.
We can get rid of the mfc code but it will cost us some effort so we can use
the pure setting in that case.

If there is not much benefit then we can leave it as it is (sparing us some
couple of days of work).

Thank you in advance.

Bart
Oct 12 '06 #1
5 1431
with /pure option, you can't have unmanaged class or function.
You can't have native code but you have not to be conform CLS (you can
if you want of course).
With this mode, no MFC, no IJW ...
So, the code is faster (because no transition managed/unmanaged).

best regards,

Nico
Bart a écrit :
Hi,

What is the benefit of using the Pure option over the Mixed one. Is therea
better performance?

We have a lot of stuff in c++ with mfc support en we want to use in our .net
apps. With mixed setting we can compile including the mfc part of our code.
We can get rid of the mfc code but it will cost us some effort so we can use
the pure setting in that case.

If there is not much benefit then we can leave it as it is (sparing us some
couple of days of work).

Thank you in advance.

Bart
Oct 12 '06 #2
"Bart" <bg**@planet.nlwrote in message
news:eH**************@TK2MSFTNGP02.phx.gbl...
Hi,

What is the benefit of using the Pure option over the Mixed one. Is there
a better performance?
The primary benefit of using /clr:pure (or /clr:safe) is that you end up
with a verifiable assembly that can be deployed and executed in partial
trust scenarios.

You may (or may not) get some benefit by avoiding native/managed transitions
as well, but that's not really what /clr:pure is about.

-cd
Oct 12 '06 #3
Thanks Carl,

You mention the option safe but it looks like i can use some unmanaged code
which makes it not illegible for partial trusted scenario's or am i wrong?
Takes us much less effort to get to this stage of being instead of the pure
one.
"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
"Bart" <bg**@planet.nlwrote in message
news:eH**************@TK2MSFTNGP02.phx.gbl...
>Hi,

What is the benefit of using the Pure option over the Mixed one. Is there
a better performance?

The primary benefit of using /clr:pure (or /clr:safe) is that you end up
with a verifiable assembly that can be deployed and executed in partial
trust scenarios.

You may (or may not) get some benefit by avoiding native/managed
transitions as well, but that's not really what /clr:pure is about.

-cd


Oct 12 '06 #4
"Bart" <bg**@planet.nlwrote in message
news:OU*************@TK2MSFTNGP03.phx.gbl...
Thanks Carl,

You mention the option safe but it looks like i can use some unmanaged
code which makes it not illegible for partial trusted scenario's or am i
wrong? Takes us much less effort to get to this stage of being instead of
the pure one.
If I understand correctly, /clr:safe makes the assembly verifiable, but it
will still require some elevated permissions to run. If you need to run in
the most restrictive environment, then /clr:pure is your answer.

-cd
Oct 12 '06 #5

"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:%2****************@TK2MSFTNGP02.phx.gbl...
"Bart" <bg**@planet.nlwrote in message
news:OU*************@TK2MSFTNGP03.phx.gbl...
>Thanks Carl,

You mention the option safe but it looks like i can use some unmanaged
code which makes it not illegible for partial trusted scenario's or am i
wrong? Takes us much less effort to get to this stage of being instead of
the pure one.

If I understand correctly, /clr:safe makes the assembly verifiable, but it
will still require some elevated permissions to run. If you need to run
in the most restrictive environment, then /clr:pure is your answer.
/clr:safe is more restrictive than /clr:pure
http://msdn2.microsoft.com/en-us/library/k8d11d4s.aspx
>
-cd


Oct 24 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sach | last post by:
Hi, I get this error error C3181: invalid operand for __typeof, expected a fully defined managed type Whenever I try to use Enum in VC++ .NET, which is actually defined in my VC++ library...
7
by: Gustavo L. Fabro | last post by:
Greetings! Some classes that once compiled without problems on VS 2003 have now problems on VS 2005 Beta 1. I'm talking about a __nogc class that is exported with __declspec(dllexport). The...
2
by: Peter Oliphant | last post by:
I've gotten my application to compile under '/clr'. I then tried '/clr pure' and it compiled immedately with no changes. What should I consider when deciding which of these two option to compile...
2
by: Vedo | last post by:
The MSDN documentation says that the GetLastError function can give undefined behavior when compiling with /clr:pure switch. Does this statement apply to both C++ interop and P/Invoke? If yes, does...
1
by: =?iso-8859-1?q?Horacio_Nu=F1ez_Hern=E1ndez?= | last post by:
Hi, I have been writing a wrapper with /clr:pure set, while I using the debug mode it was fine, when turned the mode to release it begins show me the same errors that when we try to use...
10
by: SQACPP | last post by:
Hi, I try to figure out how to use Callback procedure in a C++ form project The following code *work* perfectly on a console project #include "Windows.h" BOOL CALLBACK...
13
by: =?Utf-8?B?d3BjbWFtZQ==?= | last post by:
I have a small C++/CLI application which calls an unmanaged lib. It seems like I can't use /clr:pure and link with the unmanaged lib (LNK1313 error). The problem I have is that compiling with...
0
by: gwe123 | last post by:
The problem is that in C++ windows Forms uses the /clr:pure in it compile. When one add the "ATL" namespace and includes it will compile but at runtime it die's bigtime. How does one retrieve...
1
by: neliomourato | last post by:
hi all. I was creating a program in c++ and have to use various libraries. the problem was that some libraries need the clr and one of them unfortunately need clr\pure. I want to know if is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.