Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Debug Assertion Error Occurs while making the Static Linked Dll

Debug Assertion Error Occurs while making the Static Linked Dll

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpdebugging
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nitin_pro
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups