replace COUTOF with dimof; move hwndToolbar and hwndReBar to Document