The following example verifies that the default file (1) is opened.

   #define INCL_LOGGING
   #include <unichar.h>
   #include <os2.h>
   #include <stdio.h>
   #define ERROR_LOG_FILE_ID 1
          .
{
   APIRET rc;                      /* return code */
   ULONG service;
   UniChar filename[256];
   ULONG filename_length;
   ULONG log_file_ID;
   LOFREQUEST open_file_packet;

   service = ERROR_LOGGING_SERVICE;

   /*   Construct the LogOpenFile parameter packet  */
   open_file_packet.packet_size = sizeof(LOFREQUEST);
   open_file_packet.packet_revision_number = WPOS_RELEASE_1;
   log_file_ID = ERROR_LOG_FILE_ID;
   open_file_packet.log_file_ID = &log_file_ID;
   open_file_packet.filename_length = &filename_length; /*Indicates use the
                                                                Log File ID   */
   open_file_packet.filename = &filename;

   rc = LogOpenFile(service,                       /* service */
               &open_file_packet)              /* parameter packet  */

   if (rc != 0)
         {
         printf("LogOpenFile error: return code = %d",rc);
         return;
         }
*


[Back: LogOpenFile - Related Functions]
[Next: LogOpenFile - Topics]