Slew of errors in the Win32 port of Open Cascade 5

I’m trying to port Open Cascade 5 to Borland C++ Builder 6.x. During this work I’ve discovered numerous bugs in the Open Cascade 5.0 source code. So far I haven’t gotten further than TKernel, and the number of coding errors in the Win32 specific code is frightening. So I’m wondering if anybody has used Open Cascade on Windows for anything but simple test cases.

__leave is a Microsoft Visual C++ specific keyword that causes execution to jump to the end of the __finally block - NOT the beginning.

Testing against INVALID_HANDLE_VALUE for a handle returned by CreateEvent and friends will NOT work as expected.

Call RegCloseKey on registry handles, not CloseHandle.

Best regards
Espen Harlinn

Ivan Fontaine's picture

Most of your comments seem right. But it this
in fact possible to write big application using
opencascade. Your comments are related to rather unused OCC code segments. It means that even if they can have some pathological behaviour, most of them are seldom used.
But anyway, it's an opensource project, you can fix what you want and submit it to opencascade.

More brains improve the quality. There is a lot of room for improvements in Opencascade.

A small detail concerning the __leave statement, from the MSDN documentation:
"(..) The compound statement after the __finally clause is the termination handler."
" The effect of __leave is to jump to the end of the try-finally block. The termination handler is immediately executed."

In fact it jumps past the try-finally block, and then calls the termination handler (the code in the finally block).