HP DCE/9000 Version 1.7 Application Development Tools for HP-UX 11.0 Release Note

34 HP DCE 1.7 Application Development Tools Release Note
Developing DCE Applications with HP DCE/ 9000
Using HP DCE with C++ Applications
Using HP DCE with C++ Applications
If you want to use C++ with either standard DCE or HP’s OODCE to
create DCE applications, there are some practices you must avoid. Most
of these relate to lack of thread-safeness of C++ operations.
The following list describes the practices you should avoid. These
guidelines apply to HP C++ compiler version A.3.70 and later.
By taking these precautions, you should be able to productively use C++
or OODCE to write DCE applications.
When using unsafe constructs, be sure to use the constructs in only
one thread at a time.
DCE CMA exceptions should never be allowed to propagate into a
C++ scope. Allowing this to happen could result in destructors failing
to be executed. This can lead to memory leaks and unexpected
behavior. For example, suppose some C++ code makes a call to a C
function. Within this C function, a CMA exception can be raised. It is
very important that the CMA exception also be caught within the C
function. If it is not, then the CMA exception could propagate into the
C++ environment, resulting in unexpected behavior.
A DCE exception can also be caught in a C++ routine which has called
a DCE function. You must be sure that there are no memory
allocations within the TRY block (note that some conversions cause
memory allocation):
TRY { call a function which might do a DCE RAISE }
CATCH_ALL { handle it but don't RERAISE }
ENDTRY
Note that some library calls, and most system calls, are CMA
cancellation points, and must be wrapped as described here.
Do not enable cancellation of a thread that is running C++ code.
Asynchronous cancellation may cause a DCE exception to be raised at
any time. Synchronous cancellation may cause a DCE exception to be
raised any time a system routine is executed.
The following item applies only when programming DCE applications
using C++ and standard DCE; it does not apply when programming
with OODCE: