  The dominant contribution to the semicanonical partition function of dyonic
black holes of N=4 string theory is computed for generic charges, generalizing
recent results of Shih and Yin. The result is compared to the black hole free
energy obtained from the conjectured relation to topological strings. If
certain perturbative corrections are included agreement is found to subleading
order. These corrections modify the conjectured relation and implement
covariance with respect to electric-magnetic duality transformations.
