473,581 Members | 2,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Does the .NET framework always call the API?

I want to double check my understanding about how the .NET framework works. From
what I understand every call to the .NET framework is ultimately translated into
one of more API calls, is this correct?
Jan 22 '06 #1
28 1444
"Peter Olcott" <ol****@att.net > a écrit dans le message de news:
DlEAf.68924$QW2 .46682@dukeread 08...

|I want to double check my understanding about how the .NET framework works.
From
| what I understand every call to the .NET framework is ultimately
translated into
| one of more API calls, is this correct?

The .NET framework is a massive library mainly written in managed code.
where the framework needs to , it calls existing APIs but there is a lot of
brand new code that doesn't need the old APIs.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Jan 22 '06 #2
Try to download Reflector http://www.aisto.com/roeder/dotnet/ or have a
look at Rotor source code to see what the ".NET framework calls" exactly
do - most of them are definitely not API calls.

"Peter Olcott" <ol****@att.net > wrote in message
news:DlEAf.6892 4$QW2.46682@duk eread08...
I want to double check my understanding about how the .NET framework works.
From what I understand every call to the .NET framework is ultimately
translated into one of more API calls, is this correct?

Jan 22 '06 #3
I would expect it to only call any API's when its handling calls within the
Microsoft namespace, as this touches more on microsoft operating system
functionality - whereby the remaining namespaces are cross platform and
would be very unlikely to drop into API's.

--
Regards

John Timney
Microsoft MVP

"Peter Olcott" <ol****@att.net > wrote in message
news:DlEAf.6892 4$QW2.46682@duk eread08...
I want to double check my understanding about how the .NET framework works.
From what I understand every call to the .NET framework is ultimately
translated into one of more API calls, is this correct?

Jan 22 '06 #4
Whooo. Interesting. OK, folks, the OP just sent me on a mission to find
out. The very first thing that comes to mind is to spy on the system and
look at who is invoking whom. I cannot seem to find it on my system, but
there used to be a cool utility called APIMON.EXE that would list (log?) api
calls as they are called. It had a cartoon-like Frankenstein icon. Anyone
remember it?

It is the first step to the OP question, but now that I can't find the
thing, I would be grateful for any hints on how to *legitmately* acquire it.

--
Peace & happy computing,

Mike Labosh, MCSD MCT
"Escriba coda ergo sum." -- vbSensei
"Peter Olcott" <ol****@att.net > wrote in message
news:DlEAf.6892 4$QW2.46682@duk eread08...
I want to double check my understanding about how the .NET framework works. From what I understand every call to the .NET framework is ultimately translated into one of more API calls, is this correct?

Jan 22 '06 #5
You can download the API monitor version 1.5 from:
http://www.rohitab.com/apimonitor/

-----
Enjoy
Sharon
Jan 22 '06 #6
I am referring to those cases that result in API functionality, for example GDI
output to the display screen. Did MS write a whole new way to output things to
the screen, or merely wrap these calls in the .NET framework?

"Joanna Carter [TeamB]" <jo****@not.for .spam> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
"Peter Olcott" <ol****@att.net > a écrit dans le message de news:
DlEAf.68924$QW2 .46682@dukeread 08...

|I want to double check my understanding about how the .NET framework works.
From
| what I understand every call to the .NET framework is ultimately
translated into
| one of more API calls, is this correct?

The .NET framework is a massive library mainly written in managed code.
where the framework needs to , it calls existing APIs but there is a lot of
brand new code that doesn't need the old APIs.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer

Jan 22 '06 #7

"John Timney ( MVP )" <ti*****@despam med.com> wrote in message
news:eh******** ******@TK2MSFTN GP10.phx.gbl...
I would expect it to only call any API's when its handling calls within the
Microsoft namespace, as this touches more on microsoft operating system
functionalit y - whereby the remaining namespaces are cross platform and
would be very unlikely to drop into API's.
That isn't totally complete by any means. While the remaining namespaces
are designed tobe platform independent, many still rely on platform
dependent mechanisms. Take the System.IO namespace for example. On Windows
it is likely using CreateFile and its ilk and on Linux perhaps the posix IO
system and on a third system whatever it uses. Same goes for
System.Windows. Forms(although that doesn't port very well), some of
System.Security (WindowsIdentit y definatly uses windows APIs, Identity
classes for other systems would use that API as well, System.Threadin g(which
may or may not use system threads depending on implementation and how it is
hosted), and many other namespaces.

That is why Mono had to rewrite the class library instead of just copy it.
Large portions do rely on the underlying system, otherwise the framework
would have to replace everything from device drivers up. That doesn't mean
that every call, the string editing functions, large pieces of ASP.NET, much
of if not all of System.Xml for example, result in API calls, but many
things do..

--
Regards

John Timney
Microsoft MVP

"Peter Olcott" <ol****@att.net > wrote in message
news:DlEAf.6892 4$QW2.46682@duk eread08...
I want to double check my understanding about how the .NET framework
works. From what I understand every call to the .NET framework is
ultimately translated into one of more API calls, is this correct?


Jan 22 '06 #8
The framework classes and the run-time (the CLR) both wrap the Win32 API's
to call into OS and related services (like GDI+).

The framework (mostly written in C#) uses PInvoke to perform these API
calls, while the CLR (unmanaged C++) can directly call any API it
likes/needs. The framework and the CLR also call into system services
through COM interop, the CLR debugging, profiling and unmanaged hosting
interfaces are all COM interfaces. Some classes in the framework are thin
wrappers around COM services like ADSI, WMI, COM+., others use a mixture of
PInvoke and COM interop and a majority don't need to call into external
native code at all, but they might call into the CLR through the
internalcall interface. Some classes in v2 are written in managed C++ and
use C++ interop to call into unmanaged code.

Willy.
"Peter Olcott" <ol****@att.net > wrote in message
news:xsNAf.6893 7$QW2.29587@duk eread08...
|I am referring to those cases that result in API functionality, for example
GDI
| output to the display screen. Did MS write a whole new way to output
things to
| the screen, or merely wrap these calls in the .NET framework?
|
| "Joanna Carter [TeamB]" <jo****@not.for .spam> wrote in message
| news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
| > "Peter Olcott" <ol****@att.net > a écrit dans le message de news:
| > DlEAf.68924$QW2 .46682@dukeread 08...
| >
| > |I want to double check my understanding about how the .NET framework
works.
| > From
| > | what I understand every call to the .NET framework is ultimately
| > translated into
| > | one of more API calls, is this correct?
| >
| > The .NET framework is a massive library mainly written in managed code.
| > where the framework needs to , it calls existing APIs but there is a lot
of
| > brand new code that doesn't need the old APIs.
| >
| > Joanna
| >
| > --
| > Joanna Carter [TeamB]
| > Consultant Software Engineer
| >
| >
|
|
Jan 22 '06 #9
"Peter Olcott" <ol****@att.net > wrote in message
news:DlEAf.6892 4$QW2.46682@duk eread08...
I want to double check my understanding about how the .NET framework works.
From what I understand every call to the .NET framework is ultimately
translated into one of more API calls, is this correct?

hmmm... your question doesn't makes much sense.
I don't really know what you mean so here are some various element of
response:
API: "Applicatio n Program Interface", basically that the set of all classes
/ method / library available as a single unit from a third party, in your
case you refer the .NET API as being all the classes by default in the
framework.

an API call: when you call 1 method of the framework. When you do 1 call you
do 1 call (and not 0 or 2).

Could an API call itself?
as much as you refer your own method in your own code.
Maybe you mean: The .NET API ultimately calls into the Win32 API ?

well not always, depending on the situation.
For exemple string.Format() simple manipulate and hardly need to call any
win32 code
On the other hand Form.Show() certainly call ShowWindow() and other win32
functions.
Jan 23 '06 #10

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

Similar topics

5
2088
by: Barry Anderberg | last post by:
I'm using a tool by Sci-Tech called the .NET Memory Profiler. We have a massive .NET/C# application here and it has been exhibiting memory leak behavior for some time. Attempting to remedy the problems I am employing the aforementioned software in trying to track down the problems. After an hour or so of program execution, a snapshot of...
4
5805
by: foo | last post by:
"An unhandled exception of type 'System.NullReferenceException' occurred in Project.exe Additional information: Object reference not set to an instance of an object." This worked in ver 6, but in VB dot net it abends at the call to GetComputerName( )... Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA"
8
2148
by: Peter | last post by:
Hi, there I have created an stored procedure using the DDL below for my MS Access Database and no error occurs. Also it can create an stored procedure if I changed the parameter from "" to ""@zSampleName". OleDbcmd.CommandText = _ "CREATE PROCEDURE udpGetSampleIDByName" & vbCrLf & _ "( VarChar(64))" & vbCrLf & _ "AS" & vbCrLf & _
28
1932
by: Peter Olcott | last post by:
I want to double check my understanding about how the .NET framework works. From what I understand every call to the .NET framework is ultimately translated into one of more API calls, is this correct?
18
1963
by: cj | last post by:
members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe. I'm under the impression before you can use a class you have to make an instance of it. So how can a class be threadsafe by itself but an instance of it not be? I guess I don't get what exactly being threadsafe means. ...
14
4834
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it can be done using the designer but I intentionally don't want to use that. The one reason is that you cannot change the code generated by the...
89
5997
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be used." Could anybody tell me why gets() function is dangerous?? Thank you very much. Cuthbert
38
2418
by: JTL | last post by:
I have learnt java before and now begin to learn c++ what puzzle me is that seem that different SDKs(c++builder, vs.net, gcc..) has its own class library we know that in java there are only one uniform class library so that the codes I written in JBuilder can just copy to JCreator or Eclipse and they all run well does c++ have such an...
32
2707
by: Stephen Horne | last post by:
I've been using Visual C++ 2003 for some time, and recently started working on making my code compile in GCC and MinGW. I hit on lots of unexpected problems which boil down to the same template issue. A noddy mixin layer example should illustrate the issue... class Base { protected: int m_Field;
1
7181
by: jabbari | last post by:
Hello, Please Help us...! I have a big problem ,so i searched on google and other search engine ,then I realized that so many other people have the same problem and they, all, have'nt been able to solve it. My problem is: I want to import a dll in asp.net, and I have a major problem First i want to say that this dll works fine in a...
0
7882
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7808
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5683
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3835
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1145
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.