How to solve - error C2671: static member functions do not have 'this' pointers - using Visual Studio 2005 C++? (MFC)

  • Thread starter Thread starter BillNew
  • Start date Start date
B

BillNew

Guest
While converting code from a Mobile OS MFC Application into a Win32 VS 2005 C++ MFC Application, I have had to make things use "Static" in many places just to get the code to compile and work. All appropriate initialization to use these "Static" variables have been done as I find the issues.

Within one of those C++ (CPP) files which has to be "static" which then needs to call a function in a different C++ file while trying to use "this" pointer to call the function, I am seeing the following error message:

error C2671: 'FunctionName' : static member functions do not have 'this' pointers

The error occurs when I attempt to call the function needed with 'this' pointer when used like the following:

m_pFunction = new CSomeFunction(this );

I have searched the internet and don't find any answers that give any details on exactly how to fix such issues.

My question is: HOW or WHAT is necessary to help me fix the compile error regarding the use of 'this ' above?

I am having to relearn C++ so please don't give me general overview data as I need a real world example that shows HOW to resolve the issue.

Thanks in advance for any helpful hints!

Bill New

Continue reading...
 
Back
Top