Code adaptions of existing code for the new data type will usually not be necessary. But if HALCON handles were not held in HALCON data structures like tuples or handle classes, passing the ownership of handles from the user to HALCON might lead to undefined behavior and crashes (as HALCON will free the handle resources automatically when the last HALCON structure holding a handle reference is destroyed).
For these cases HALCON offers a legacy mode to transfer the ownership of handles to the user code. In this mode, handles have to be cleared explicitly. HALCON operators will return handles as numeric values and accept them as input. The legacy handle mode can be switched on and off using set_system:
set_system('legacy_handle_mode', 'true')
Mixing of current and legacy code is not recommended. If absolutely required, handles can be converted to numeric values (see handle_to_integer) and back again (see integer_to_handle).
Cast ambiguities like HShapeModel(tuple) can lead to source code incompatibilities. In C++ these can be avoided by defining HCPP_LEGACY_HANDLE_API before including HalconCpp.h. To avoid cast ambiguities in .NET, please adapt the legacy code, for example by changing tuple to tuple.L.