fix calling of OpenResFile procedure