I have checked return values of all the functions for simplicity, I have added code without return value check.


Also I have tried with AFX_MANAGE_STATE(AfxGetStaticModuleState( )), but of no use.