Resistive and resistive-superconducting hybrid magnets can generate dc magnetic fields much higher than conventional superconducting NMR magnets but the field spatial homogeneity and temporal stability are usually not sufficient for high-resolution NMR experiments. Hardware and technique development addressing these issues are presented for high-resolution NMR at magnetic fields up to 40T. Passive ferromagnetic shimming and magic-angle spinning are used effectively to reduce the broadening from inhomogeneous magnetic field. A phase correction technique based on simultaneous heteronuclear detection is developed to compensate magnetic field fluctuations to achieve high spectral resolution.