You might have to switch the module state.
Try doing this AFX_MANAGE_STATE(AfxGetStaticModuleState( )); in your exported Dll function.