CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2002
    Posts
    7

    Help me fellow console C++ programmers !!

    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

  2. #2
    Join Date
    Jul 2002
    Location
    Don't Know, Don't Care
    Posts
    346
    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.

    C G C F A D--Feel the Noise

    "When your life goes nowhere and leads back to me, doesn't that tell you something?"
    ~Gray Area Fury

  3. #3
    Join Date
    Oct 2002
    Posts
    36
    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

  4. #4
    Join Date
    Oct 2002
    Location
    Boston
    Posts
    40
    You might want to refer:
    Inside VC++, author: Kruglinski
    and MSDN.
    If you want u can refer MSDN at
    http://msdn.microsoft.com/library/de...ples_index.asp
    Go through samples given in that site.

  5. #5
    Join Date
    Sep 2002
    Location
    Philadelphia ***Epoch: Timeless***
    Posts
    560
    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.
    SolarFlare

    Those who cling to life die and those who defy death live. -Sun Tzu

    cout << endl;
    return 0;
    }

  6. #6
    Join Date
    Sep 2002
    Posts
    28

    Scheme of window application

    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.

  7. #7
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    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
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  8. #8
    Join Date
    Sep 2002
    Posts
    28

    Advantages of pure win32 API style

    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]

  9. #9
    Join Date
    May 2001
    Location
    Oslo, Norway
    Posts
    610
    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,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured