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 Failed(File wingdi.cpp, line : 1054)

Debug Assertion Failed(File wingdi.cpp, line : 1054)

Scheduled Pinned Locked Moved C / C++ / MFC
c++debugginghelp
2 Posts 2 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.
  • D Offline
    D Offline
    dashprasannajit
    wrote on last edited by
    #1

    Hi All, I created one MFC extension dll and loaded the exporated function in another sample MFC SDI application on click of the toolbar events.This application is almost looks simmilar to paintbrush where the exported functions are having the implementaion of painting methods.The MFC sample EXE is just to call the extention DLL and call each exported fucntion(in .DEF file of MFC Extension DLL) to test whether the actions are having or not but for one function i am getting runtime error while excuting the MFC sample EXE i.e. "Debug Assertion Failed". Program path of the sample MFC SDI exe...... File : wingdi.cpp Line : 1054 I am giving following code snippets.... HDC hdc = NULL; UINT uIntRect = 0;//RECTANGLE; HWND hwnd = NULL; BOOL uReturnVal= FALSE; LPFNDLL_drawShape lpfndll_drawRectangle; HMODULE hModule = LoadLibrary("D:\\FancyViewer\\Notebook_13July2006\\Notebook\\Debug\\Notebook.dll"); if(hModule) { lpfndll_drawRectangle = (LPFNDLL_drawShape)GetProcAddress(hModule,"drawShape"); if (!lpfndll_drawRectangle) { AfxMessageBox("GetProcAddress() method is failed"); FreeLibrary(hModule); return; } else { CRect rect; GetClientRect(rect); CPaintDC dc1(this); CDC dcMem; dcMem.CreateCompatibleDC(&dc1); hwnd = (HWND)dc1.GetWindow(); hdc = dc1.Detach(); uIntRect = RECTANGLE; // call the function of drawShape method for rectangle of Notebook.dll uReturnVal = lpfndll_drawRectangle(hdc,uIntRect,hwnd); ASSERT(uReturnVal == TRUE); char buffer[65]; MessageBox(_itoa(GetLastError(),buffer,10),NULL,MB_OK); return; } } else { AfxMessageBox("Load library failed"); return; } GetLastError();

    N 1 Reply Last reply
    0
    • D dashprasannajit

      Hi All, I created one MFC extension dll and loaded the exporated function in another sample MFC SDI application on click of the toolbar events.This application is almost looks simmilar to paintbrush where the exported functions are having the implementaion of painting methods.The MFC sample EXE is just to call the extention DLL and call each exported fucntion(in .DEF file of MFC Extension DLL) to test whether the actions are having or not but for one function i am getting runtime error while excuting the MFC sample EXE i.e. "Debug Assertion Failed". Program path of the sample MFC SDI exe...... File : wingdi.cpp Line : 1054 I am giving following code snippets.... HDC hdc = NULL; UINT uIntRect = 0;//RECTANGLE; HWND hwnd = NULL; BOOL uReturnVal= FALSE; LPFNDLL_drawShape lpfndll_drawRectangle; HMODULE hModule = LoadLibrary("D:\\FancyViewer\\Notebook_13July2006\\Notebook\\Debug\\Notebook.dll"); if(hModule) { lpfndll_drawRectangle = (LPFNDLL_drawShape)GetProcAddress(hModule,"drawShape"); if (!lpfndll_drawRectangle) { AfxMessageBox("GetProcAddress() method is failed"); FreeLibrary(hModule); return; } else { CRect rect; GetClientRect(rect); CPaintDC dc1(this); CDC dcMem; dcMem.CreateCompatibleDC(&dc1); hwnd = (HWND)dc1.GetWindow(); hdc = dc1.Detach(); uIntRect = RECTANGLE; // call the function of drawShape method for rectangle of Notebook.dll uReturnVal = lpfndll_drawRectangle(hdc,uIntRect,hwnd); ASSERT(uReturnVal == TRUE); char buffer[65]; MessageBox(_itoa(GetLastError(),buffer,10),NULL,MB_OK); return; } } else { AfxMessageBox("Load library failed"); return; } GetLastError();

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      Where does the assertion take place, I mean which line in your code?


      Nibu thomas A Developer Programming tips[^]  My site[^]

      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