Thread: Windows API and .NET Framework?

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    45

    Windows API and .NET Framework?

    Hello people.

    I will soon be taking a tutorial in programming with the WinAPI, but later on I want to integrate it with some of the controls and features provided by the Windows .NET Framework. Is this possible, or is the technology of WinAPI to old for that. I would also like to know if WinAPI programs will be supported in future versions of windows such as windows 7?

    Please tell me if the WinAPI and the .NET framework can be integrated as if they cant be, i wont bother wasting my time on the WinAPI tutorial,

    Thanks in advance,
    mintsmike

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I think you have a wrong understanding of what WinAPI is.
    WinAPI is the C-portion of the interface to interface with Windows™.
    dotNet is basically the C#-portion of the interface to interface with Windows™.
    dotNet GUI and WinAPI do not mix well, if at all.

    And yes, since WinAPI is the basic portion of Windows--its foundation, so to speak, it will remain and it is still left in Win7.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    45
    So, which interface do you reccomend to me.

    Im thinking .NET, but i would like a second oppion,

    Thanks in advance,
    mintsmike

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    dotNet is more higher-level and easier to use than WinAPI and a lot more flexible.
    That being said, however, I despise all that has to do with dotNet and would go for a C++ Framework GUI Library (such as wxWidgets among others).
    But don't entirely rely on my opinion and take a look at the 3 for yourself, if you can.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    I thought the point of .NET was that it was available across several languages and that the only downside was the megabytes of framework that you had to attach. At least know what .NET is before you go espousing your opinion.
    Last edited by whiteflags; 06-28-2009 at 04:23 AM.

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I know what dotNet is.
    It's Microsoft's huddly-cuddly all-in-one language-wide platform.
    And I don't like it.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    I thought the point of .NET was that it was available across several languages and that the only downside was the megabytes of framework that you had to attach. At least know what .NET is before you go espousing your opinion.
    And that it is only available on Windows.

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    For now. It's a standard, so measures are being taken to make it available on other platforms.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by cyberfish
    And that it is only available on Windows.
    I had the impression that due to Mono that is no longer the case.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  10. #10
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    POSIX has been a standard for a few decades, too, and Windows is still lacking most of the POSIX functions.

    A standard doesn't mean much if people don't implement it.

  11. #11
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    I am not sure how good Mono is (since I don't use .Net myself), so I won't comment on that.

    But reading the Wikipedia page -
    Mono (software) - Wikipedia, the free encyclopedia
    Mono’s implementation of those components of the .NET stack not submitted to the ECMA for standardization has been the source of patent violation concerns for much of the life of the project. In particular, discussion has taken place about whether Microsoft could destroy the Mono project through patent suits.

    The base technologies submitted to the ECMA, and therefore also the Unix/GNOME-specific parts, may be non-problematic. The concerns primarily relate to technologies developed by Microsoft on top of the .NET Framework, such as ASP.NET, ADO.NET and Windows Forms (see Non standardized namespaces), i.e. parts composing Mono’s Windows compatibility stack. These technologies are today not fully implemented in Mono and not required for developing Mono-applications. Richard Stallman has claimed it may be "dangerous" to use Mono because of the possible threat of Microsoft patents.[9]

    On November 2, 2006, Microsoft and Novell announced a joint agreement whereby Microsoft agreed to not sue Novell’s customers for patent infringement.[10] According to Mono project leader Miguel de Icaza,[11] this agreement extends to Mono but only for Novell developers and customers. It was criticized by some members of the free software community because it violates the principles of giving equal rights to all users of a particular program (see Novell and their Patent Agreement with Microsoft).
    I got the impression that the issue is still quite muddy.

  12. #12
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Win32 API calls can be made from C# using the import functionality in C#. There are also files available on CodeGuru and other sites like it that define all the windows messages so you do not have to trap for constant values when trapping for certain messages.

    .NET is fine except the Win32 API does much more. I find it odd that Win32 is still needed for many advanced Win32 functionalities. One would think .NET could handle it all but alas it cannot and does not. .NET is awesome as it is but it needs to implement more of the Win32 API before I would consider it done.

    From a GUI standpoint there are also certain messages for which there is no C# equivalent handler for. For these you will have to manually handle them by deriving your Form class from IMessageFilter and then overriding PreMessageFilter().

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Get .net framework version
    By kairozamorro in forum C# Programming
    Replies: 0
    Last Post: 05-18-2009, 01:02 AM
  2. A question about windows programming
    By Hussain Hani in forum Windows Programming
    Replies: 16
    Last Post: 05-23-2007, 07:38 AM
  3. FlashWindowEx not declared?
    By Aidman in forum Windows Programming
    Replies: 3
    Last Post: 05-17-2003, 02:58 AM
  4. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM
  5. Visual J#
    By mfc2themax in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 10-08-2001, 02:41 PM