FAQ: Visual C++ for Macintosh Frequently Asked QuestionsLast reviewed: October 6, 1997Article ID: Q123181 |
The information in this article applies to:
SUMMARYThis article contains answers to some of the most frequently asked questions regarding Visual C++ for Macintosh. NOTE: The Macintosh is manufactured by Apple Computer, Inc., a vendor independent of Microsoft; we make no warranty, implied or otherwise, regarding the performance or reliability of the Macintosh.
Index to Questions
MORE INFORMATION
Windows-based application developers use the Visual C++ Cross-Development Edition for Macintosh to leverage their existing source code and tools expertise when porting applications from the Windows operating system to the Macintosh. This Macintosh edition of Visual C++ is an add-on to Visual C++ version 2.0 running on Intel platforms. It contains all the tools you need to build high-performance, native Macintosh-based applications. In addition, the toolset includes the Windows Portability Libraries, an implementation of the Win32 API and architecture on System 7.x. This static linked library enables a single set of source code, written to either MFC or directly to the Win32 API, to target both Windows and the Macintosh. The ported application has the familiar Macintosh user interface.
The Macintosh edition hosts on Windows NT Workstation version 3.5. It requires that Visual C++ version 2.0 be running on an IBM PC compatible computer. For the minimum installation, you'll need 80 megabytes of free disk space and at least 16 megabytes of RAM. The product is a remote host/target environment that requires an ethernet or serial connection to the target Macintosh for file transfer and debugging.
The Visual C++ Cross-Development Edition is sold as an add-on to Visual C++ version 2.0. The add-on extends the Visual C++ environment to include additional menu items, dialogs, and tools that you need to build and debug Macintosh executables from a host machine running Windows NT. By using this product, you can use all the powerful features of Visual C++ version 2.0 to create Macintosh applications.
Using this product, you (a developer targeting the Macintosh) work in an extended version of the Visual C++ version 2.0 development environment. You can use all the powerful Visual C++ version 2.0 features for Windows development including the IDE, Wizards, MFC version 3.0, and the integrated debugger. The only two exceptions are Just In Time debugging, which requires Windows NT structured exception handling, and incremental linking.
The Visual C++ Cross-Development Edition includes a Macintosh version of the Microsoft Foundation Classes (MFC) version 3.0. Programming to MFC is the way to achieve the maximum percentage of common code between the Windows and Macintosh versions of an application.
Of the current Macintosh hardware platforms, Visual C++ targets 68020 or higher systems running System 7.0 and above.
The Windows Portability Library, which ports Win32 API code to the Macintosh, does not currently provide wrapper functions for the Macintosh implementation of Microsoft OLE. However, Macintosh-specific code can be included in an application to use OLE on the Macintosh. For more information about Microsoft's native Macintosh OLE implementation, please see the documentation included with the Microsoft OLE version 2.01 Software Development Kit (SDK) for the Macintosh.
The Windows Portability Library does not provide wrapper functions for the Apple implementation of ODBC, level 1 on the Macintosh, although Macintosh- specific calls to these functions can be included in an application. For information about Apple ODBC support, please see the Apple Computer documentation.
The first step in preparing to use this product is to move your sources to the Win32 API. The Macintosh is a 32-bit platform, so the portability libraries are based on the Win32 API. Programming to Win32 enables multi-platform targeting of Windows version 3.1 (through Win32s), Windows NT, Windows 95, and now System 7.x.
A porting tool, provided as a sample application, identifies non-portable and implementation-dependent APIs in your source code. Run the tool from within Visual C++. With it, you can specify and scan for different types of portability issues. When it identifies an offending line of code, it highlights the non-portable code; you can press F1 to get detailed help from the online portability reference.
The IDE for the Visual C++ Cross Development Edition is the same as its Windows counterpart with several new features tailored to Macintosh targeting. These features are a superset of the functionality available in the core IDE. The project management facilities are extended for the new target type, Macintosh Application. The project property pages have new options for setting the build rules for Macintosh targets. The debugger has been enhanced to display 68K machine state information, register contents, and disassembler.
The Visual C++ Cross Development Edition for Macintosh adds Macintosh targeting build tools to your existing Visual C++ version 2.0 installation. These tools support the same C/C++ language interpretation as the Windows product. This ensures source code compatibility across platforms.
The Visual C++ Cross Development Edition for Macintosh leverages the same optimizing technology used in Visual C++ version 2.0 for Windows to produce the smallest and fastest applications for the Macintosh.
Developing, editing, building, and debugging all occurs on the computer running Windows NT, not on the Macintosh. There are two Macintosh-hosted components that support communication with the computer running Windows NT:
The Windows Portability Libraries (WPL) enable applications written to the Win32 API to share a common code base between their Macintosh and Windows versions. These static linked libraries use the Win32 API as the portability API for targeting the Macintosh platform. The resulting application has the familiar Macintosh user interface. In cases where the Win32 and System 7.x APIs are similar, the libraries provide a direct translation (TextOut() to DrawText()). In other cases, the libraries are an implementation of Windows functionality on the Macintosh (Child Windows).
The libraries support the Win32 features for which there are Macintosh analogs including window creation and management, message processing, mouse and keyboard events, and controls such as list and combo boxes. There is no current support for multi-media, COMM (direct serial port access), or console APIs.
The C/C++ optimizing compiler for the 680x0 uses the same technology as the Visual C++ version 2.0 Intel compiler for creating high performance executables. The portability layer is designed to perform at 95% of native and is roughly 450K in size. The toolset also includes a profiler that can be used to identify performance critical sections of code.
This depends largely on your application. To take advantage of specific Macintosh or Windows-only features (like Publish and Subscribe on the Mac or multiple printers on Windows), you'll have to write edge code. Other applications may not find it necessary to write any platform-specific code at all.
|
Additional query words: faq
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |