-
API discouraged in .NET?
I just got my copy of .Net yesterday...
anyway, it looks like you can use API as usual, but the MSDN help says most of the functions can be obtained through wrappers of the .net framework.....
Well, i couldn't find much info past that....
So where are these wrapper functions? Say for example, GetTickCount...?
-
You can get 'GetTickCount' from the TimeSpan class.
The use of the api is discouraged, but it cant be avoided. However as MS releases updated version of the Framework, we should see less use of the API.
-
From what i have read about .Net using the API is discouraged because of a number of reasons.
1.) Since the API is not object based the developer must learn complex function calls with long lists of arguements.
2.) Some of the naming schemes for the functions is inconsistent.
3.) Since the API was written in C++ getting the calling conventions right on data types such as strings is very messy.
Ive heard that in time they will try and abstract away the API, so i guess this is a start with the wrapper functions that you talked about using. :)
-
These "Wrappers" aren't really direct wrappers around API functions. They're just parts of the Framework that work well as alternatives to the API functions.
Basically, the claim is that most of what you had to use API functions for before can now be done by using the classes provided by the .NET Framework.