none
A funny thing using C++ in VS2008, VS2010 and VS2015 using member function pointers (::*).

    Question

  • I noticed that a virtual member function called as (this->*m_pointer)() that returns a pointer (::*) to another virtual member function works fine in code compiled for 32 bit, but it returns an invalid pointer when compiled for 64 bit when built using VS2008, VS2010 and VS2015.

    The same code works fine in Mac OSX and Linux builds.

    I fixed the problem by not returning the pointer by the function, but I thought the compiler people at Microsoft might be able to make use of this information.

    medusade

    Monday, April 18, 2016 1:07 AM

All replies

  • >I noticed that a virtual member function called as (this->*m_pointer)() that returns a pointer (::*) to another virtual member function works fine in code compiled for 32 bit, but it returns an invalid pointer when compiled for 64 bit when built using VS2008, VS2010 and VS2015.
    Can you show a simple example that reproduces this problem?
    That would allow someone to look into the issue further.

    Dave

    Monday, April 18, 2016 7:13 AM
  • Hi medusade,

    Thanks for posting on MSDN forum.

    Please share some detailed steps and screenshots to help us reproduce your problem in our side, which can help us find out what's happened.

    If possible, please share some code snippet here. Thanks.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.


    Tuesday, April 19, 2016 2:05 AM
    Moderator