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. Overloaded member function not found in CNoteMgr

Overloaded member function not found in CNoteMgr

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++graphicsperformancetutorial
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, I create MFC extension DLL and wrote couple of functions adding one class i.e.CNoteMgr in the DLL workspace. In the class header of CNoteMgr, there are two functions whose signature is given as below : BOOL CNoteMgr::drawLine(HDC,HPEN,POINT,HWND); BOOL CNoteMgr::drawCurve(HDC,POINT,HWND); The implementation has been done in different way for line drawing and drawing curve. But while compiling the DLL, i am getting the following errors as below : **************************************************************************************** Compiling... Notebook.cpp D:\FancyViewer\Notebook\Notebook.cpp(78) : warning C4101: 'msg' : unreferenced local variable NoteMgr.cpp D:\FancyViewer\Notebook\NoteMgr.cpp(632) : error C2511: 'drawLine' : overloaded member function 'int (struct HDC__ *,struct HPEN__ *,struct tagPOINT [],struct HWND__ *)' not found in 'CNoteMgr' d:\fancyviewer\notebook\notemgr.h(29) : see declaration of 'CNoteMgr' D:\FancyViewer\Notebook\NoteMgr.cpp(665) : error C2511: 'drawCurve' : overloaded member function 'int (struct HDC__ *,struct tagPOINT [],struct HWND__ *)' not found in 'CNoteMgr' d:\fancyviewer\notebook\notemgr.h(29) : see declaration of 'CNoteMgr' D:\FancyViewer\Notebook\NoteMgr.cpp(838) : warning C4800: 'unsigned char' : forcing value to bool 'true' or 'false' (performance warning) Generating Code... Error executing cl.exe... **************************************************************************************** PLEASE NOTE that the error id is "C2511". I do not know where the point of overloading comes as the method names are different. I found from MSDN regarding the error C2511 and tried all possibilities but still the problem persists. ========================================================================================= MSDN says that for the error C2511 'identifier' : overloaded member function not found in 'class' No version of the function is declared with the specified parameters. Possible causes : (1)Wrong parameters passed to function. (2)Parameters passed in wrong order. (3)Incorrect spelling of parameter names. The following sample generates C2511: Example -> // C2511.cpp class C { int c_2; int Func(char *, char *); }; int C::Func(char *, char *, int i) { // C2511 // try ... // int C::Func(char *, char *) { return 0; }========================================================================================= Can anyone help me out please ??

    N 1 Reply Last reply
    0
    • D dashprasannajit

      Hi, I create MFC extension DLL and wrote couple of functions adding one class i.e.CNoteMgr in the DLL workspace. In the class header of CNoteMgr, there are two functions whose signature is given as below : BOOL CNoteMgr::drawLine(HDC,HPEN,POINT,HWND); BOOL CNoteMgr::drawCurve(HDC,POINT,HWND); The implementation has been done in different way for line drawing and drawing curve. But while compiling the DLL, i am getting the following errors as below : **************************************************************************************** Compiling... Notebook.cpp D:\FancyViewer\Notebook\Notebook.cpp(78) : warning C4101: 'msg' : unreferenced local variable NoteMgr.cpp D:\FancyViewer\Notebook\NoteMgr.cpp(632) : error C2511: 'drawLine' : overloaded member function 'int (struct HDC__ *,struct HPEN__ *,struct tagPOINT [],struct HWND__ *)' not found in 'CNoteMgr' d:\fancyviewer\notebook\notemgr.h(29) : see declaration of 'CNoteMgr' D:\FancyViewer\Notebook\NoteMgr.cpp(665) : error C2511: 'drawCurve' : overloaded member function 'int (struct HDC__ *,struct tagPOINT [],struct HWND__ *)' not found in 'CNoteMgr' d:\fancyviewer\notebook\notemgr.h(29) : see declaration of 'CNoteMgr' D:\FancyViewer\Notebook\NoteMgr.cpp(838) : warning C4800: 'unsigned char' : forcing value to bool 'true' or 'false' (performance warning) Generating Code... Error executing cl.exe... **************************************************************************************** PLEASE NOTE that the error id is "C2511". I do not know where the point of overloading comes as the method names are different. I found from MSDN regarding the error C2511 and tried all possibilities but still the problem persists. ========================================================================================= MSDN says that for the error C2511 'identifier' : overloaded member function not found in 'class' No version of the function is declared with the specified parameters. Possible causes : (1)Wrong parameters passed to function. (2)Parameters passed in wrong order. (3)Incorrect spelling of parameter names. The following sample generates C2511: Example -> // C2511.cpp class C { int c_2; int Func(char *, char *); }; int C::Func(char *, char *, int i) { // C2511 // try ... // int C::Func(char *, char *) { return 0; }========================================================================================= Can anyone help me out please ??

      N Offline
      N Offline
      nguyenvhn
      wrote on last edited by
      #2

      Changed as the folowing: BOOL CNoteMgr::drawLine(HDC,HPEN,POINT*,HWND); BOOL CNoteMgr::drawCurve(HDC,POINT*,HWND); Because of your implementation is POINT[]

      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