Debug Assertion Error Occurs while making the Static Linked Dll
-
Hello Gurus I have an application in VC++ in which i'll show the rtf file in Rich EDit Ctrl , i completely success to show the file , but the problem is when i make a DLL of that exe application there is an exception in the Dll i had make a DLL (Regular MFC static Linked Dll) in which i'll pass the HInstance ,and path of the file like this extern __declspec(dllexport)bool RTFDisplay::ShowFilePreview(HINSTANCE ist,TCHAR *csFilePath ,void *FileInfo, BYTE bFileType ,TCHAR *csImagePath) { CRTFViewerApp *pApp = (CRTFViewerApp*)AfxGetApp() ; dll_inst=ist; HINSTANCE cur=GetDllInstanceHandle(); AfxSetResourceHandle( cur ); if(bFileType == RTF_FILE ) { CRichPreviewDlg Ob ; Ob.m_csFilePath = csFilePath ; Ob.m_FileInfo = (tagFileInfo*)FileInfo ; Ob.m_csImagePath = csImagePath ; Ob.DoModal(); } AfxSetResourceHandle( dll_inst); return pApp->m_bRetVal; } When i run this DLL there is an exception Debug Assertion Fail , when i get into the code then i found "HINSTANCE cur of GetDllInstanceHandle();" has NULL value.and after this error promt I had make so many DLL earlier with "textctrl" , "listctrl" but i can't face such type of problem Kindly Look into the matter Thanks