Issue with member function pointers and a feature wish

I’ve run into more issues than I had expected – here’s another one. Pointers to member functions now require a fully qualified name and you also need to use the & operator. It’s not a big deal really, but if your code uses pointers to members in several places, it’s a bit of a task to fix them all. I thought of writing a regular expression so I could do it in one go, but then I reckoned that it’d take me more time to come up with a safe, working regexp than it’d take me to fix all the errors manually.

m_pfnGetPixels = Get8bitPixels; //error C3867

The right way is :-

m_pfnGetPixels = &CBFile::Get8bitPixels;

I wish there was a feature to sort the compiler errors in the Output window by error number. I’ve got 400-500 files in my solution and sometimes, it’s easier for me to work on one compiler error at a time. Say I am fixing the member function pointer issue mentioned above; I’d then be able to fix the issue in all my source files and then recompile to work on the next error. Right now, I have to do a top-to-bottom error fixing and it’s a bit confusing as I am dealing with different types of errors – more strain on the brain 😦

Advertisements

One thought on “Issue with member function pointers and a feature wish

  1. Hi, I was browsing the internet looking for a way to suppress the c3867 compiler error in Visual Studio 2005 can came upon this blog.

    “I wish there was a feature to sort the compiler errors in the Output window by error number.” – In the Error List screen of the IDE you can click the ‘Description’ tab and it should sort all the errors for you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s