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

  • Home
  • SEARCH
  • 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 138237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:13:57+00:00 2026-05-11T07:13:57+00:00

I would like to pass a COM method as a function argument but I

  • 0

I would like to pass a COM method as a function argument but I get this error (Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80×86):

error C3867: ‘IDispatch::GetTypeInfoCount’: function call missing argument list; use ‘&IDispatch::GetTypeInfoCount’ to create a pointer to member

What am I missing?

Thank you very much.

#include <atlbase.h>  void update( HRESULT(*com_uint_getter)(UINT*), UINT& u ) {    UINT tmp;    if ( S_OK == com_uint_getter( &tmp ) ) {       u = tmp;    } }  // only for compile purpose, it will not work at runtime int main(int, char*[]) {    // I choose IDispatch::GetTypeInfoCount just for the sake of exemplification    CComPtr< IDispatch > ptr;    UINT u;    update( ptr->GetTypeInfoCount, u );    return 0; } 
  • 1 1 Answer
  • 0 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. 2026-05-11T07:13:57+00:00Added an answer on May 11, 2026 at 7:13 am

    As morechilli pointed out this is a C++ issue. Here it is the solution, thanks to my colleague Daniele:

    #include <atlbase.h>  template < typename interface_t > void update( interface_t* p, HRESULT (__stdcall interface_t::*com_uint_getter)(UINT*), UINT& u ) {    UINT tmp;    if ( S_OK == (p->*com_uint_getter)( &tmp ) ) {       u = tmp;    } }  // only for compile purpose, it will not work at runtime int main(int, char*[]) {    // I choose IDispatch::GetTypeInfoCount just for the sake of exemplification    CComPtr< IDispatch > ptr;    UINT u;    update( ptr.p, &IDispatch::GetTypeInfoCount, u );    return 0; } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 179k
  • Answers 179k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The keyword you're looking for is list comprehensions: >>> x… May 12, 2026 at 3:52 pm
  • Editorial Team
    Editorial Team added an answer There is a set of functions in os module (os.WIFCONTINUED,… May 12, 2026 at 3:52 pm
  • Editorial Team
    Editorial Team added an answer You'd have to go into the source because window.jQuery is… May 12, 2026 at 3:52 pm

Related Questions

I would like to pass a reference of a method into another method and
I would like to create an equivalent if this Java method as PL/SQL function
I've got a wizard which needs to validate if a user is logged in
I want to use small images and repeat them as backgrounds for components in

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.