473,327 Members | 2,069 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,327 software developers and data experts.

question on Managed code

I've a pretty basic question on managed code. I read through couple
of.net documentation, and reached a state where I know that managed
code would be run by the .Net run time and it has so and so
advanantages

My question is if I've a unmanaged custom dll(say a.dll) built using
VC++ 6.0 and if I were to create a wrapper class in .Net(say b.dll) to
invoke the unmanaged dll, will my b.dll become a managed code or still
it is unmanaged? As per my understanding b.dll is managed as it is
running under the .Net environment?

When people say my code is 100% managed code, then do they mean they
have written and used everything written under a .Net environment?

Sep 19 '06 #1
5 1313
Your b.dll is still managed but you are calling unmanaged code.
Thus, you haven't altered the overall environment.

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money publishing .NET articles at
http://www.eggheadcafe.com


<ac*************@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
I've a pretty basic question on managed code. I read through couple
of.net documentation, and reached a state where I know that managed
code would be run by the .Net run time and it has so and so
advanantages

My question is if I've a unmanaged custom dll(say a.dll) built using
VC++ 6.0 and if I were to create a wrapper class in .Net(say b.dll) to
invoke the unmanaged dll, will my b.dll become a managed code or still
it is unmanaged? As per my understanding b.dll is managed as it is
running under the .Net environment?

When people say my code is 100% managed code, then do they mean they
have written and used everything written under a .Net environment?

Sep 19 '06 #2
<ac*************@gmail.comwrote:
My question is if I've a unmanaged custom dll(say a.dll) built using
VC++ 6.0 and if I were to create a wrapper class in .Net(say b.dll) to
invoke the unmanaged dll, will my b.dll become a managed code or still
it is unmanaged? As per my understanding b.dll is managed as it is
running under the .Net environment
Your DLL would not be running managed code. It would be called from .Net
using an Interop and all calls to and from your DLL would incur a
performance penalty as .Net continually makes security checks.
When people say my code is 100% managed code, then do they mean they
have written and used everything written under a .Net environment?
That's pretty much exactly what they mean..

--
Chris Mullins, MCSD.NET, MCPD:Enterprise
http://www.coversant.net/blogs/cmullins
Sep 19 '06 #3
Achutha,

In addition to the other messages, a 100% Net environment is only using
classes from the .Net System or the .Net Micorosoft.Visual.Basic namespace,
those are all creating managed code.

An added DLL (Com) can be used very fine, but those have to be on the client
computer as well, while in the above situation there only has to be the .Net
redistribute

Cor

<ac*************@gmail.comschreef in bericht
news:11**********************@m73g2000cwd.googlegr oups.com...
I've a pretty basic question on managed code. I read through couple
of.net documentation, and reached a state where I know that managed
code would be run by the .Net run time and it has so and so
advanantages

My question is if I've a unmanaged custom dll(say a.dll) built using
VC++ 6.0 and if I were to create a wrapper class in .Net(say b.dll) to
invoke the unmanaged dll, will my b.dll become a managed code or still
it is unmanaged? As per my understanding b.dll is managed as it is
running under the .Net environment?

When people say my code is 100% managed code, then do they mean they
have written and used everything written under a .Net environment?

Sep 19 '06 #4
The RCW (runtime callable wrapper) WOULD be managed code, but it would be
invoking the un-managed COM component.
"Chris Mullins" <cm******@yahoo.comwrote in message
news:OB**************@TK2MSFTNGP05.phx.gbl...
<ac*************@gmail.comwrote:
>My question is if I've a unmanaged custom dll(say a.dll) built using
VC++ 6.0 and if I were to create a wrapper class in .Net(say b.dll) to
invoke the unmanaged dll, will my b.dll become a managed code or still
it is unmanaged? As per my understanding b.dll is managed as it is
running under the .Net environment

Your DLL would not be running managed code. It would be called from .Net
using an Interop and all calls to and from your DLL would incur a
performance penalty as .Net continually makes security checks.
>When people say my code is 100% managed code, then do they mean they
have written and used everything written under a .Net environment?

That's pretty much exactly what they mean..

--
Chris Mullins, MCSD.NET, MCPD:Enterprise
http://www.coversant.net/blogs/cmullins


Sep 19 '06 #5

<ac*************@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
| I've a pretty basic question on managed code. I read through couple
| of.net documentation, and reached a state where I know that managed
| code would be run by the .Net run time and it has so and so
| advanantages
|
| My question is if I've a unmanaged custom dll(say a.dll) built using
| VC++ 6.0 and if I were to create a wrapper class in .Net(say b.dll) to
| invoke the unmanaged dll, will my b.dll become a managed code or still
| it is unmanaged? As per my understanding b.dll is managed as it is
| running under the .Net environment?
|
b.dll is managed code when built using a pure managed code compiler.
| When people say my code is 100% managed code, then do they mean they
| have written and used everything written under a .Net environment?
|

No they mean that their code was build using a "pure managed code" compiler
producing "Verifiable IL", like tere are C# and Vb.Net. VC 7.x and VC8.x can
build "pure managed code" assemblies, but they can also produce mixed code
assemblies, these are NOT pure managed assemblies, they contain native code
blobs, that means they are NOT Verifiable.

Willy.
Sep 19 '06 #6

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

Similar topics

9
by: Tim Mulholland | last post by:
Hello all, Our company is trying to write some code in C#/.NET that we don't want an end user to be able to see. The algorithms are not that complex, but are sensitive such that if a user could...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
24
by: glenn | last post by:
I understand that C# does not generate dll's that can be called from other application development platforms. So now I have to find another way to write a client app that can be utilized within...
3
by: Steve Marsden | last post by:
Hi I am an experienced C programmer and we have a large app written in C which I have just recompiled with /clr to start to add in managed code to use .NET framework and windows forms bit by...
4
by: BCC | last post by:
Hi, I have a need to read in a very simple xml file and initialized some objects from the data. I was reading on the ms website that .net contains its own XML parser, and it sounds pretty good...
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...
12
by: doug | last post by:
I understand the basics of what managed code offers and that you open yourself up to security issues if you allow unmanaged code. We already have a decent amount of VB6 code to include COM DLLs. ...
6
by: nicolas.hilaire | last post by:
Hi all, i'm not totally clear with some concepts about managed and unmanaged code. I'm asking myself some questions : - i've a MFC app, i want to use the framework dotnet by switching to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.