Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 670923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:19:01+00:00 2026-05-14T00:19:01+00:00

i need a Function Pointer from a base class. Here is the code: class

  • 0

i need a Function Pointer from a base class. Here is the code:

class CActionObjectBase
{
  ...
  void AddResultStateErrorMessage( const char* pcMessage , ULONG iResultStateCode);
  ...
}

CActionObjectCalibration( ): CActionObjectBase()
{
 ...
 m_Calibration = new CCalibration(&CActionObjectBase::AddResultStateErrorMessage); 
}

class CCalibration
{
 ...
 CCalibration(void (CActionObjectBase::* AddErrorMessage)(const char*, ULONG ));
 ...
 void (CActionObjectBase::* m_AddErrorMessage)(const char*, ULONG );
}

Inside CCalibration in a Function occurs the Error. I try to call the Function Pointer like this:

if(m_AddErrorMessage)
{
 ...
 m_AddErrorMessage("bla bla", RSC_FILE_ERROR);
}

The Problem is, that I cannot compile. The Error Message says something like:
error C2064: Expression is no Function, that takes two Arguments.

What is wrong?

regards
camelord

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:19:01+00:00Added an answer on May 14, 2026 at 12:19 am

    You need to invoke m_AddErrorMessage on an object, something like:

    (something->*m_AddErrorMessage)(...)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a c++ class derived from a base class in a framework. The
in C++, I can easily create a function pointer by taking the address of
I have a base class that I want to look like this: class B
Currently, I am using a type-safe enum class from Boost Vault : Which Typesafe
Suppose I need to implement factory function which returns object O which inherits/has members
Update 1: Corrected nonsense code! Thanks for comments, I made a hash of the
I need some answers to basic questions. I'm lost again. :( q1 - Is
I was recently working on a piece of C++ code for a side project
Toward the end of Chapter 16 of the C++ Primer I encountered the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.