### Porting Code Between Platforms

To use IBM C and C++ Compilers to port code from one platform to another, you must first migrate your existing project; that is, you must convert an existing project implemented using another compiler to IBM C and C++ Compilers Version 3.6 on the same platform. For example, a project developed in VisualAge C++ 3.0 for OS/2 must be migrated to IBM C and C++ Compilers 3.6 on the OS/2 platform. You can then use IBM C and C++ Compilers to develop applications or to port your application to other platforms. For this version of IBM C and C++ Compilers, only migration from VisualAge C++ for OS/2 Version 3.0, VisualAge for C++ for Windows Version 3.5, and C Set++ for AIX Version 3.1.4 are supported.

Guidelines

Porting means moving an existing project to another platform. The project must first be migrated to IBM C and C++ Compilers Version 3.6.

C and C++ code is portable across the three platforms supported by IBM C and C++ Compilers.

IOC is portable between IBM C and C++ Compilers platforms, with the following exceptions:

> - Dialog templates are only available in OS/2 and Windows.
> - DDE is only available in OS/2 and Windows.
> - Multimedia is only available in OS/2 and Windows.
> - Please see the ReadMe file for an updated list.

The use of Operating System APIs is, in general, not portable. For instance, if you use application programming interface (APIs) from the Win32 SDK, the OS/2 Toolkit, or AIX documentation (that are not implemented in the VisualAge for C++/C run time), your application will not port.

There is an exception to this lack of API portability; the IBM C and C++ Compiler's OS/2 Toolkit contains the Open32 library. Open32 is a tool that helps Windows application developers move their applications to OS/2. It supports many Win32 functions and messages. However, IBM OpenClass provides a more complete portability solution.

Tools

CONVRC is a conversion tool that converts resource script files between OS/2 and Windows. However, both the OS/2 and Windows toolkit headers must be available to run the tool.

The Integrated Resource Editor (IRE) records all control types and styles when you import a resource file into the IRE; however, you will see only the control types and related styles that are found on the target operating system.

When you use the resource conversion tool, you must be aware of the differences a particular control may have between one operating system and the other. The resource conversion tool works only with a limited set of controls common to both systems, and with a limited set of styles for those controls. When writing out the final resource file, the conversion tool ignores controls found on one operating system and not on the other.

IRCCNV is a conversion tool that converts Windows resource script files to an OS/2 format that the AIX resource compiler understands. While IRCCNV will not convert Windows bitmaps, icons, or cursors to OS/2 format, the AIX resource compiler understands Windows bitmap formats.
IBM Open Class Library User Interface Classes (ICLUI) will not load dialog templates on AIX. However, the resource compiler will not generate error messages if you have them.

On the Windows operating system, ICLUI classes only understand pop up menus with the form:

> `MENUEX 1
> BEGIN`

> > `MENUITEM "item1",2
> > MENUITEM "item2",3`

> `END`

Thus, ICLUI classes do not understand pop up menus with the form:

> `MENUEX 1
> BEGIN`

> > `POPUP "",0
> > BEGIN`

> > > `MENUITEM "item1",2
> > > MENUITEM "item2",3`

> > `END`

> `END`

Porting IBM Open Class Library
Converting Resources