Developed by: John
Walker, JSW Technology
Distributed by: Aonix
Copyright John Walker & JSW Technology 1997-2001. All Rights
Reserved.
The information contained herein is subject to change without
notice.
ObjectAda is a trademark of Aonix
Microsoft, Visual C++, Win32 and Windows
NT are trademarks of Microsoft, Inc.
Last updated: 4 June 2001
Please send your comments and suggestions to john@jswalker.demon.co.uk.
Go back to Ada Foundation Classes
Go back to start of JSW Technology Home Page
AFC (the Ada Foundation Classes) is a thin Ada binding to the Microsoft Foundation Classes (MFC).
Training and reference material for using MFC in C++ are widely available. The AFC documentation describes the mapping from C++ to Ada.
AFC includes Ada samples which illustrate the use of AFC. The Scribble sample is derived from the Scribble tutorial used by Microsoft to illustrate the development of Windows applications using MFC. Samples derived from the examples in Programming Windows 95 with MFC and Programming Windows with MFC Second Edition by Jeff Prosise and published by Microsoft Press are also included.
Go to start of Ada Foundation Classes FAQ
Version 4.1 of the Ada Foundation Classes provides a binding to the following MFC header files:
Go to start of Ada Foundation Classes FAQ
We are always interested in your requirements. Please send your comments and suggestions to john@jswalker.demon.co.uk and/or adamark@sd.aonix.com.
Go to start of Ada Foundation Classes FAQ
My preferred approach is to start with a working application, such as the Scribble sample, and proceed by stepwise refinement. Most of the structure, and much of the code, will be common to many applications.
As with development in C++, this will require access to MFC reference material for both the novice and experienced MFC programmer.
Go to start of Ada Foundation Classes FAQ
The Microsoft Foundation Classes (MFC) provide a comprehensive framework for the development of Windows applications.
The Ada Foundation Classes (AFC) enable the Ada programmer to code a Windows application in Ada by interfacing to the framework provided by MFC. This combines the benefits of coding in Ada with the widely used Microsoft framework for building Windows applications.
The "thin" binding provided by AFC preserves the structure and naming of MFC allowing the use of widely available training and reference material for MFC.
Go to start of Ada Foundation Classes FAQ
A precise answer to this question has proved illusive.
The Ada Foundation Classes Discussion Paper Mapping C++ to Ada is in preparation to address this question and the more general issues of mapping between C++ and Ada.
Go to start of Ada Foundation Classes FAQ
C++ classes in MFC are not mapped to tagged records in AFC and therefore Ada classes as such cannot be derived from MFC.
However, the AFC documentation and samples illustrated how to create the Ada equivalent of a C++ class derived from an MFC class. The Derive Ada Class Tool (DACTool) is provided to assist with this process. It generates the Ada equivalent of a derived class in C++.
Some of the issues surrounding this subject will be discussed in the Ada Foundation Classes Discussion Paper Mapping C++ to Ada which is currently under construction.
DACTool forms part of the Symbol Table Viewer Tool (STViewer). STViewer is a browser for the symbol tables used to generate AFC. It can be used to inspect the C++ symbols in MFC and their Ada equivalents.
Go to start of Ada Foundation Classes FAQ
Yes. An Ada package, refered to as a class package, is generated for each C++ class.
A class package interfaces to the visible, that is non-private, member functions of the class. A nondispatching function interfaces directly to the C++ member function. A virtual function is implemented in Ada as a dispatching call through the VFT to the proper member function.
For classes with non-pure virtual functions a nondispatching package is also generated. The nondispatching package interfaces to the visible, that is non-private, virtual function members specific to the class thereby providing nondispatching calls to those member functions.
Go to start of Ada Foundation Classes FAQ
AFC provides a programming interface to the MFC framework and, as such, it is an enabling technology for the development of GUI applications in Ada.
AFC does not include tools to support the development of GUI applications in Ada.
See also:
Go to start of Ada Foundation Classes FAQ
Yes. You should use the Resource Editor to generate the .res file and resource.h.
The .res file is linked directly into your application.
The #define constants in resource.h should be declared and used in your Ada source code to access the resources.
The samples illustrate the use of resource files.
Go to start of Ada Foundation Classes FAQ