there are two programs one is exe ane another one is Dll in EXE there is no error and in Dll we face a exception error i 'll pass the path of the file in Navigate2 like this memset(szFolderPath, 0x00, MAX_PATH); SHGetSpecialFolderLocation(NULL,CSIDL_RECENT, &pidl); BOOL f = SHGetPathFromIDList(pidl,szFolderPath); csTempPath.Format(_T("%s"),szFolderPath); INT nTempIndex =csTempPath.Find(_T("Recent")); csTempPath =csTempPath.Mid(0,nTempIndex); csTempPath =csTempPath + _T("Local Settings\\Temp\\Sample") + csExt; hDevice = CreateFile(csTempPath, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, CREATE_ALWAYS,0,NULL); if(hDevice) { pView->Navigate2(csTempPath); pView->EnableWindow(FALSE); pView->ShowWindow(SW_NORMAL); } the same code successfully runs in an exe but when i make a dll ithe navigate function gives the error . when i debug the code error shows in this Class C:\....MFC\SRC\VIEWHTML.CPP just have a look the code where excatly the error promts i'll mark the arrow void CHtmlView::Navigate2(LPCTSTR lpszURL, DWORD dwFlags /* = 0 */, LPCTSTR lpszTargetFrameName /* = NULL */, LPCTSTR lpszHeaders /* = NULL */, LPVOID lpvPostData /* = NULL */, DWORD dwPostDataLen /* = 0 */) { ASSERT(m_pBrowserApp != NULL); COleSafeArray vPostData; if (lpvPostData != NULL) { if (dwPostDataLen == 0) dwPostDataLen = lstrlen((LPCTSTR) lpvPostData); vPostData.CreateOneDim(VT_UI1, dwPostDataLen, lpvPostData); } COleVariant vURL(lpszURL, VT_BSTR); COleVariant vHeaders(lpszHeaders, VT_BSTR); COleVariant vTargetFrameName(lpszTargetFrameName, VT_BSTR); COleVariant vFlags((long) dwFlags, VT_I4); ===>>> m_pBrowserApp->Navigate(vURL, vFlags, vTargetFrameName, vPostData, vHeaders); } kindly solve the issue thanks