The conversion from a .CSC file to an .IDL file is handled by the CTOI program. For example, to convert the file MYDOG.CSC to an IDL file, make sure all the CSC, SC, and PSC files referenced by MYDOG.CSC are accessible, and then invoke the program as shown in the following command line:
ctoi mydog.csc
Note: Converting a Workplace Shell application from a CSC file to an IDL file requires the SC files from the previous OS/2 Toolkit installed on your system (in the SC directory), and all the ones that you might have created. The IDL subdirectory from the OS/2 Toolkit contains the IDL files for the public Workplace Shell classes and objects.
In this example, the CTOI program produces a file called MYDOG.IDL containing the definitions in IDL format. In many cases, you should be able to compile, install and run your application without further modification. However, the following situations will require manual intervention:
OIDL IDL data: struct info infoBuffer; interface: ... { typedef struct info info; ... implementation { info infoBuffer; ... }; data: char achMyArray[20]; interface: ... { typedef char myarraytype[20]; ... implementation { attribute myarraytype achMyArray; ... }; data: unsigned char chFlag; attribute octet chFlag; data: char *argv[]; char **argv;
AStructure resolveMyIdentity(in string pszIdent), struct;
OIDL IDL int x, private; #ifdef __PRIVATE__ int x; VOID mymethod(), private; VOID mymethod(); #endif
To include private data and methods in the processing of an IDL file, the SOM compiler should be invoked with either the -P option or the -D_PRIVATE_ option, as shown in the following command lines:
sc -p yourname.idl sc -d__PRIVATE__ yourname.idl
Note that there are two underscore ( __ ) characters before and after the word PRIVATE.
interface M_Cat;
Because IDL is strongly typed (unlike OIDL), data structures and constants should be declared before referencing them, in order to eliminate unnecessary warning messages during compilation. This is required if an interface repository (.IR) file is to be created from the IDL file.