OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
where nnnn is the process ID of the application making the call.
dce_error_inq_text()
Opens a message catalog, extracts a message identified by a message ID,
and places the message in the space pointed to by the text parameter. If
the message catalog is inaccessible, and there is a default message in
memory, the default message is copied into the space passed. If neither
the catalog nor the default message is available, a status code is placed
in the status output parameter and the message is returned as a
hexadecimal number; the routine always returns a printable message.
This routine existed in prior releases of DCE and has been modified for
DCE Version 1.1 to use the default message arrays. Programs prior to
Version 1.1 that use the routine do not need to be modified.
For example, assume that the following message is defined in an
application’s sams file:
start
code error_msg
text "Error: %s"
action ""
explanation "DCE error status message"
end
The following code fragment shows how dce_error_inq_text( ) could
be used to retrieve the error status received from a DCE routine:
dce_error_string_t error_string;
unsigned32 status;
int error_inq_status;
uuid_t type_uuid, obj_uuid;
<. . .>
rpc_object_set_type(&obj_uuid, &type_uuid, &status);
if (status != rpc_s_ok)
{
dce_error_inq_text(status, error_string, &error_inq_status);
dce_printf(error_msg, error_string);
}
3.3.2 Message Retrieval Routines
The following three routines retrieve messages, but do not print them.
dce_msg_get_msg()
Retrieves a message (identified by a global message ID) from a message
catalog, and returns a pointer to a malloc( )’d space containing the
message. The routine determines the correct message catalog and opens
3 12 Tandem Computers Incorporated 124245