• Welcome to Computer Association of SIUE - Forums.
 

Question to those who program for the Windows API/MFC/.NET

Started by David Falbe, 2003-10-02T08:48:58-05:00 (Thursday)

Previous topic - Next topic

David Falbe

I'm kind of getting bored lately just making C++ console applications even if they can do some interesting things. The only class at the university i see that offers windows programming maybe that .net class or 275 to a lesser degree, but i want to learn how do it with c++ or C#.

So i'm trying to learn windows programming on my own head first basically, i'm undecided if i should go the MFC route or learn the new .Net foundation stuff.

Its a pain to read through the MSDN libraries and other relate text and websites just to understand whats going on when you make a simple winapp. So the question i have is what is the best books or websites you found that can help make this easier?

DaleDoe

I don't know a lot about the .NET stuff yet, but MFC is kinda a pain :hammer2:.  I expect MFC will be around for a while because a lot of programmers know how to do it, but if I were to have the choice of knowing one, I would choose .NET because from what I see from GUIs with C#, it is easier and I expect it to become quite popular.  But since I am not yet experienced in .NET, I may not be the most qualified to answer the question 8-).
"If Tyranny and Oppression come to this land, it will be in the guise of fighting a foreign enemy." -James Madison

R. Andrew Lamonica

.NET Is defiantly the way to go, because it is very easy and the code is generated for you so you can have a look at it to see what’s going on after using the GUI designer.  The only problem is that people need the .NET framework to use your programs and that can be a 25MB download (although a very useful one because it includes command line compilers and is used by every .NET program)  If you are interested in seeing how Windows really works you can find many good books on the Windows API.  If you would like I can dig up one of my old GUI programs written in VC6 and post it.  Internally, they are quite simple It is a small jump (just two or three API calls) from a console application to one with an Event Queue.  The Event Queue allows you to program like you are using VB except that you must examine each event yourself and decide what function to call rather than having that done for you.

I have a suspicion that eventually most code will be JIT compiled like .NET rather than natively compiled by the original developer like native C++ code.  So it is probably best to go ahead and learn .NET, Java AWT or Java Swing because they are likely to be of more use.  The MFC is probably going to disappear because it filled almost the same niche as .NET will and Microsoft is clearly pushing developers to use .NET at the present.  Most of the really cool API features (Speech, DirectX) are all being converted to .NET Libraries so MFC programmers have to use older versions.

DaleDoe

Quote.NET Is defiantly the way to go

No, I think QT, some Xwindows library, or at least non-Microsoft API would be the defiant way to go. :-D:smartass:
"If Tyranny and Oppression come to this land, it will be in the guise of fighting a foreign enemy." -James Madison

Guest

if its no problem i would like to see how you wrote the app.

David Falbe


DaleDoe

That depends on how complicated your program is.  In my experience using applications written with JIT are only significantly slower on start up :whistling:-_-:zzz:.  This is only noticable, though for larger applications or apps. on really outdated systems.  So if you don't complain about Microsoft  products:bluescreen: being slow because they're bloated, you probably won't complain much with JIT.
"If Tyranny and Oppression come to this land, it will be in the guise of fighting a foreign enemy." -James Madison

R. Andrew Lamonica

It is possible that an application written in .NET can take longer to startup then a natively compiled one because the first thing .NET does is compile the application.  Fortunately, this speed is still much better than code that is never naively compiled like a Visual Basic 6 application or a non-JIT compiled Java application (which is almost all of them.)  The other great thing about .NET applications is that after they are compiled once the native-code is cached in a global assembly cache.  This means that it does not get re-compiled as long as you use it every so often so the slowdown is only for the first few seconds of the first time you run the application.  Admittedly, every time a developer changes his/her code the assembly (Microsoft’s name for .NET executables) will need to be re-compiled, but we are used to that and I have written insanely-complicated programs in C# that still compile quite quickly.

Guest

Lamonica , i have another question was reading somewhere that microsoft is going to release or already have released the a net foundation for other platforms. Are they going to implement it to the point where windows applications can be ported easily with minimal alterations.

Stiffler

I saw the .NET Framework for Mac and BSD on the MS site last year. I don't know if they updated the version to 1.1 yet or not. I'll try to find the links. I know the links are hard to find. Well, they were a year ago. Microsoft will not support Linux because of the GPL. MS Hates that because code cannot be sold, wereas under the BSD license code can be sold. I should have said programs written with code under said license...

[edit]
The only thing I can find for now is the "Shared Source Common Language Infrastructure 1.0 Release". This will allow you to compile C# on BSD and Mac OSX. To go to the page Click Here.
[/edit]

Hope this helps.

Jon
Retired webmaster of CAOS.

R. Andrew Lamonica

As Stiffler said, the .NET Framework including the CLR (Common Language Runtime Infrastructure) are being ported to BSD and Mac (essentially the same thing.)  I don’t use either so I do not know what progress has been made or how easy it is to install.  With Windows you can get the  command line compilers from Windows Update(http://windowsupdate.microsoft.com).  I suspect that this has as much to do with future software releases as it does with licenses.  In the future MS will probably compile all its software in .NET IL so having many ports of the Framework will allow them to sell the same software to more users.  

Because the underlying architecture, requirements and some other specifics are open standards (http://www.ecma-international.org/publications/standards/ECMA-335.HTM) anyone with the time can make a .NET CLR in much the same way that there are many Java Virtual Machines.  Because of this I have seen at least two .NET implementation projects for Linux.  Mono (http://www.go-mono.com/) is the one I have heard the most about but still have not tried.