Bikram, Really Thank You so much for your code. I found the Problem with my code. Actually I've created a Win32 DLL thru' the Application wizard first and then I set the property to use MFC in Shared Dialog. So, i've no CWinApp Object Created, rather i've only the DLLMain function in the Application, which leads to the failure of the Application call by which i get a NULL pointer, of the AfxGetApp call in the RunModalLoop function. Again I thank you for your help. Kind Regards, Subbi.