Improved radiation driven wind models are constructed to calculate detailed synthetic UV spectra of hot luminous stars. The model improvements comprise: a very detailed multilevel NLTE treatment of 29 of the most important ionization stages, in particular C, N, O and Fe using accurate atomic data; the approximate inclusion of EUV radiation by shock heated matter in the ionization rates and a simple simulation of photospheric line blocking. Due to the improved NLTE opacities the calculated rates of mass-loss are increased by nearly a factor of two relative to previous models. The direct ionization by EUV shock radiation has important effects on the lines of the highest ionization stages, whereas line blocking is needed to reproduce the lowest stages of ionization that are observed. A detailed comparison between observed and calculated synthetic spectra of two 0-stars, zeta Puppis in the Galaxy and Melnick 42 in the LMC, has been carried out to develop diagnostic tools for the determination of stellar parameters, abundances and stellar wind properties from the ultraviolet spectra. The following results are obtained: Zeta Puppis. (i) The effective temperature obtained from the analysis of optical hydrogen and helium absorption lines is confirmed, however, the gravity is larger by 0.1 dex. (ii) A solar abundance of iron yields a reasonable fit of the rich Fe IV and V spectra. The abundances of carbon, nitrogen and oxygen indicate that the atmosphere is mixed with CNO-burned material. (iii) A mass-loss rate of 5.1 10(-6) M. yr-1 resulting from a self-consistent wind model gives the best fit to the UV-spectrum. In this model helium recombines from He++ to He+ in the outer wind layers as a result of the high wind density and photospheric line blocking in the wavelength region of the He II resonance line. Melnick 42. (i) The HST UV spectrum indicates a higher effective temperature than found by Heap et al. (1991) from the analysis of the optical lines. The stellar parameters that lead to an optimum fit of the UV-spectrum are: T(eff) = 50 500 K, log g = 3.785 (cgs), R/R. = 26, M/M. = 150, log(L/L. ) = 6.6. Melnick 42 is thus the most massive and most luminous star known. (ii) The mass-loss rate is 3 10(-5) M. yr-1 with and uncertainty of 50%. This value is in agreement with the observed emission strength of Halpha and He II 4686. (iii) The difference in T(eff) relative to Heap et al. (1991) is attributed to the effect of the strong stellar wind and its influence on the formation of the optical hydrogen and helium lines. (iv) The abundance of all elements (including C, N, 0 and Fe) is reduced relative to the Sun by a factor of four.