ADC Home > Reference Library > Technical Q&As > Legacy Documents > Graphics & Imaging >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
|
Q: I'm working on a GX print extension that needs to call some C++ routines. Is there a way to accomplish this with either MPW or Metrowerks? A: It is possible to include C++ code in a QuickDraw GX print extension, but it may be difficult, depending on the compiler you choose. There is a related article in issue 4 of develop, which is available on the Developer CD Series. This code does everything necessary to initialize your C++ vtables, since in a stand-alone code resource (your print driver), this is not done for you by the runtime support. Note that vtable layouts are C++ compiler specific. Support for CFront is being discontinued, so you may want to look into using Symantec's C/C++ for Macintosh or MetroWerks C/C++. The glue code referred to in the develop 4 issue article needs to be modified to work with Symantec's/MetroWerks' compilers. Note that documentation on exact vtable layout in Symantec/MetroWerks may not be readily available. You could also use the Code Fragment Manager. However, this would work only for the PowerPC environment at this time, since a Code Fragment Manager is not yet available for the 68K environment. CFM fragments can be written in any language, including C++. |
|