-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Pooran-Prasad
Message 4 in Discussion


Hi Shaju,
 
Microsoft Visual Studio 
.NET (VS.NET) is capable of producing both managed and unmanaged code. Basically 
unmanaged code is the kind that runs directly against the Win32 API and the x86 
instruction set, the kind we're used to. Managed code runs on .NET's CLR (common 
language runtime), the equivalent of Java's VM. 

Managed code comes in 
two forms, safe and unsafe. Safe code only accesses memory that's been 
previously written to, doesn't assign data to variables of the wrong type, etc. 
The idea is that it's stable and secure, within the environment of the CLR. 


By default, C#.NET and VB.NET both produce verifiably safe code. There 
is a tool in Microsoft Visual Studio .NET called PEVerify that checks code is 
verifiably safe. It is possible to produce code that's not verfiably safe by 
using managed C++ or using the 'unsafe' keyword in C#. However, if that code 
attempts an unsafe operation when running it will throw a VerifierException and 
avert attempts at compromising security, etc. 


Managed code is code that is written to target the services 
of the common language runtime (see What is the Common Language Runtime?). In 
order to target these services, the code must provide a minimum level of 
information (metadata) to the runtime. All C#, Visual Basic .NET, and 
JScript .NET code is managed by default. Visual Studio .NET C++ code 
is not managed by default, but the compiler can produce managed code by 
specifying a command-line switch (/CLR). 

<o:p></o:p> 

Though unasked, I 
would like to add details on managed data. Closely related to managed 
code is managed data�data that is allocated and de-allocated by the common 
language runtime's garbage collector. C#, Visual Basic, and JScript .NET data is 
managed by default. C# data can, however, be marked as unmanaged through the use 
of special keywords. 


Visual Studio .NET C++ data is unmanaged by default 
(even when using the /CLR switch), but when using Managed Extensions for C++, a 
class can be marked as managed by using the __gc keyword. As the name suggests, 
this means that the memory for instances of the class is managed by the garbage 
collector. In addition, the class becomes a full participating member of the 
.NET Framework community, with the benefits and restrictions that brings. An 
example of a benefit is proper interoperability with classes written in other 
languages (for example, a managed C++ class can inherit from a Visual Basic 
class). An example of a restriction is that a managed class can only inherit 
from one base class. <o:p></o:p>
 
Hope that helps 
:)
    
Have a great day :)
    
Pooran Prasad


R. Pooran Prasad
Itreya Technologies Pvt Ltd.,
Mail: 
[EMAIL PROTECTED]
Phone(Off) :  
5200179/80/81/82/83 Extn: 50
Mobile:  +91 98860 29578

  -----Original Message-----
From: Arian_Intellect 
  [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 
  1:24 PM
To: BDOTNET
Subject: Difference Between Managed 
  Code and UnManaged Code

 
  
    
      
      New Message on BDOTNET
    
      

  Difference Between Managed Code and UnManaged 
    Code


    
      
      
        Reply

        
          
            
            
               
              Reply to Sender   Recommend 
              Message 1 in 
                Discussion 
      
        
          
            
            
              From: Arian_Intellect 
            
              

                Hi,
                 
                Can anybody tell me the 
                
Difference Between Managed Code and UnManaged Code
                
Thanks In Advance
                Shaju Thomas
e-Cosmos 
                Technologies Ltd.,
Mail: [EMAIL PROTECTED]
Phone(Off) :  
                51217038/39 Extn: 132
Mobile:  +91 98455 
                21794
View other groups in this 
    category. 





-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to