Click to See Complete Forum and Search --> : How do I start on Windows Programming ?
Alienationer
November 1st, 2002, 11:00 AM
Please help me ! i have been trained in the arts of the C++ language and its beauty but now i need a visual app and i have no idea how to get started, can someone tell me the fastest easiest way to go from normal console C++ into Visual C++ without feeling ignorant and stupid ?? it seems like a totally different language
THank You
Waldo2k2
November 1st, 2002, 11:28 AM
Unfortunatly, there is no easy way. Look up tutorials online, but be warned, you're going to need some aspirin. I myself have not been able to migrate my console apps over to gui apps.
dumah
November 1st, 2002, 01:13 PM
Read some tutorials, read some books.
Here's a good site for some basic windows code - http://www.foosyerdoos.fsnet.co.uk/
Also, look at getting Programming Windows by Charles Petzold
agni256
November 1st, 2002, 01:55 PM
You might want to refer:
Inside VC++, author: Kruglinski
and MSDN.
If you want u can refer MSDN at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample/html/_core_microsoft_foundation_class_library_samples_index.asp
Go through samples given in that site.
SolarFlare
November 1st, 2002, 02:18 PM
If you use the Class Wizard as your sherpa you are half way there.
Windows programming can be quite confusing at first, but for the most part the classes you need to work with are self descriptive to help you out as much as possible.
doublehook
November 3rd, 2002, 08:18 PM
I recommend you learn how to create a window app
without using MFC. You will be learn more.
This is the scheme:
Header files (<windows.h>, etc, etc)
A prototype for window procedure
The main function
You register a window class structure
You create a main window using CreateWindow
You show the main window
You enter the message loop
translate each message
dispatch each message
when the loop finishes the main function returns
The window procedure definition
You can write code for each kind of Window Message
(WM_CHAR, WM_PAINT) or use the default window procedure
The application is a loop of message processing, from begining to the end. You must learn each win32 API needed.
Yves M
November 4th, 2002, 08:15 AM
I agree with doublehook, it is useful to know about plain Win32 API windows programming before you start with a framework like MFC.
I would suggest to use VC (if you have this one) to generate a simple Hello World application. Make the first one you do with menus etc to get a general idea. Then make the last one in the list, since it's a bit more complex.
Read through the source code and look up the functions that are not defined in the source in MSDN. They are the basic API functions you need. Look at the resources and resource.h, maybe resource.rc (open it in binary mode, or in a text editor). Don't worry if you don't understand everything.
But yes, get a book, that will help as well :)
doublehook
November 4th, 2002, 09:27 PM
If you learn writing windows applications
with plain win32 API, you can easy write the same
applications in assembler language (i.e. with MASM)
Remember:
1 include headers
2 windowproc prototype
3 global data if necessary
4 main function
4.1. register window class
4.2. create window
4.3. show window
4.4. message loop
5 windowproc function
[6 other functions]
Amn
November 5th, 2002, 08:53 AM
I agree with doublehook and Yves on this. Win32 API is the beginning of the road here. If you master it, you will have MUCH MUCH easier time learning the abovelying layers of software.
Always remember: In Windows everything you are being served is based on WinAPI. And i mean EVERYTHING. You can think of it as the Windows Assembly Language <- because it is the lowest level (at least to us API users, which dont need to tweak with x86 code in windows) you may access at the user level. Note that even windows programs made in assembly use references to WinAPI.
In short: learn it :)
msdn.microsoft.com/library is a good place to start. Dont be afraid of it, its huge because its all-in-one. If you search or follow the hierarchy menues intuitevely you will undoubtefully come to your place of interest. If you have the extensive language you speak of, its a no brainer.
The key points of WinAPI are:
1. Handles - everything (almost) is referred by handles which are pointers to their relevant Kernel objects. Lousely comparision will be comparing them to C++ objects pointers. Dont compare too much though - handles are handles, and you should use them as handles :) Examples are handles of windows, threads, mutexes, user sessions, drawing pens, brushes and fonts and many more.
2. Callbacks - WinAPI was out when C++ was on the march, but still to hold it down to HAL (Hardware Abstraction Level) and for it to conform to different languages which may use it, it was made as a set of functions, and thus what we know under "virtual functions" is not available there - thus "callbacks" are used. A Callback is an address of a function you specify to some other component, and it wall "call it back" for you. Also loosely resembles Virtual Functions in C++
3. WinAPI is split into several key components, each of which deserves a path of learning: GDI, GDI+, Terminal Services API, DirectX API, DDK API, etc.
These are the KEY points, i suggest reading CodeGuru, MSDN and generally other good articles on Internet for learning more. Also get a good book, which takes you from the start to the middle of WinAPI ;) And keep in mind - WinAPI is NOT MFC, nor it is COM+, COM, OWL or WFC.
Cheers,
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.