|
From: Ioannis V. <no...@ho...> - 2003-03-04 15:59:34
|
-------Original Message-------=0D =0D From: Zodiaq=0D Date: =D4=F1=DF=F4=E7, 4 =CC=DC=F1=F4=E9=EF=F2 2003 11:12:50 =F0=EC=0D To: Dev...@li...=0D Subject: Re: [Dev-C++] Longhorn API=0D =0D Hello Ioannis and all Dev-C++ users,=0D =0D Tuesday, March 4, 2003, 3:03:42 AM, Ioannis wrote as follows:=0D =0D IV> "Longhorn=0D IV> Next major OS version=0D IV> Will contain Avalon the fully .NET Win32 API.=0D IV> OS integration with .NET reaches its conclusion.=0D IV> Everything that is currently in Windows will be rewritten as managed code.=0D IV> "=0D =0D So, does it mean that if I want to write some progs for new windows=0D platform I have to (I must) learn .NET API??? Does .NET look at least=0D something similar to Win32 API or rather like MFC?? Damn, these are=0D baaaaaad news for me... but Longhorn going to be released at 2004 or=0D 2005?? So I have some more time... damn it!=0D =0D =0D That's why i informed you. :) .NET consists of a virtual machine (like Java) and a complete API.=0D =0D =2ENET is an independent system, Windows and .NET will *coexist* for some= time The source code does not get compiled to binary code but to intermediate bytecode which is compiled at run-time by the virtual machine (named CLR)= =2E=0D =0D Because of this, all languages share the same API and code written in one language can work with another. For example you can inherit a Visual Basi= c 7 class to your C++ class, throw an exception in C++ and catch it in C# and= so on. A programming language in .NET world is just a dialect, you can use whichever you like (for example Oberon).=0D =0D =2ENET provides garbage collection so when you allocate memory on the fre= e store you do not have to release it.=0D =0D Since .NET is a virtual machine you can think that you write programs for= it and not your real architecture. That's why it has its own assembly langua= ge, the assembler MS provides is called ILASM and its disassembler is called ILDASM. Its assembly language has the notion of objects too!=0D =0D Reference: http://www.microsoft.com/mspress/books/5771.asp=0D =0D =0D Since .NET was designed after Java it has advantages over it. Except of t= he fact that it is an open framework for any language while java's framework= is only for java, it provides options on how your code gets compiled to nati= ve binary code at run-time when it is executed. Line by line, function by function or it gets all compiled to native binary code at the time of installation (but i do not know how to configure it yet).=0D =0D The API is high level and *complete*. For example:=0D =0D =0D (part of a real .NET program)=0D =0D #include "stdafx.h"=0D =0D #using <mscorlib.dll>=0D #include <tchar.h>=0D #using <System.dll>=0D #using <system.windows.forms.dll>=0D #using <system.drawing.dll>=0D =0D using namespace System;=0D using namespace System::ComponentModel;=0D using namespace System::Windows::Forms;=0D using namespace System::Drawing;=0D =0D __gc class CppForm:public Form=0D {=0D Button *btn1, *btn2;=0D Label *theLabel;=0D GroupBox *gbox;=0D RadioButton *rb1, *rb2, *rb3;=0D ComboBox *combo1;=0D TextBox *text1;=0D MainMenu *menuBar;=0D MenuItem *fileMenu, *item1, *item2;=0D =0D =0D =0D =0D // ...=0D =0D =0D =0D =0D void Setup_Buttons()=0D {=0D btn1=3Dnew Button;=0D btn1->Text=3D"OK";=0D =0D btn1->Size=3DSystem::Drawing::Size(70,25);=0D btn1->Location=3DPoint(130,225);=0D btn1->Click+=3Dnew EventHandler(this, &CppForm::Btn1_Clicked);=0D Controls->Add(btn1);=0D =0D btn2=3Dnew Button;=0D btn2->Text=3D"Cancel";=0D =0D btn2->Size=3DSystem::Drawing::Size(70,25);=0D btn2->Location=3DPoint(210,225);=0D Controls->Add(btn2);=0D btn2->Click+=3Dnew EventHandler(this, &CppForm::cancel_clicked);=0D =0D }=0D =0D =0D public:=0D CppForm()=0D {=0D Text=3D"Test Form";=0D FormBorderStyle=3DFormBorderStyle::Fixed3D;=0D Size=3DSystem::Drawing::Size(450,350);=0D Setup_Menu();=0D Setup_Buttons();=0D Setup_Label();=0D Setup_Group();=0D Setup_Combo();=0D Setup_Text();=0D =0D }=0D =0D };=0D =0D // This is the entry point for this application=0D int __stdcall WinMain()=0D {=0D Application::Run(new CppForm);=0D =0D =0D =0D return 0;=0D }=0D =0D =0D =0D =2ENET architecture (except of the API) is standardised by ECMA, together= with its assembly language. You can download its standard for free and see its assembly language at=0D =0D http://www.ecma-international.org/publications/standards/ECMA-335.HTM=0D =0D =0D An example of its assembly language:=0D =0D assembly Test {}=0D =0D =0D =2Emethod static int32 AddTen(int32)=0D { =0D ldarg.0=0D ldc.i4 10=0D add=0D ret=0D }=0D =0D =0D =2Eclass Test=0D { =0D .method static void main()=0D { =0D .entrypoint=0D ldc.i4.1=0D ldftn int32 AddTen(int32)=0D calli int32(int32)=0D pop=0D ret=0D }=0D }=0D =0D =0D =0D Since this is the case, there are open source .NETs too. For example:=0D =0D http://www.go-mono.com/=0D =0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys=20 |