locked
How evaluate functions in the immediate window? RRS feed

  • 問題

  • Hello to all,

    During a debug session in Visual C++ 2005, I want to evaluate a member function of some object.

    I can't.

    It''s something like:

    filename.size(), which is a const member function which returns a member variable.

    I tried to do that in:

    1) A watch, and it's gives me the CXX0052: Error: member function not present
    2) The imediate window, and it's gives me the CXX0052: Error: member function not present
    3) The Command window
    4) I googled this up and found 0 answers, and actually zero questions (maybe my searching skills are not that good)

    ** Does somebody know how to do this?
    2008年7月22日 上午 06:49

解答

  • Dear Uriel Salomon,

     

    I am not familiar on VC++, but from what you tell in point 1 and point 2, seems like filename this object does not have "size" this function. What is the filename object type?

    2008年7月30日 上午 02:34

所有回覆

  • Dear Uriel Salomon,

     

    I am not familiar on VC++, but from what you tell in point 1 and point 2, seems like filename this object does not have "size" this function. What is the filename object type?

    2008年7月30日 上午 02:34
  • if it is a static function, try to call as YourClass::YourMethod()  rather than YourClass.YourMethod()
    2008年8月20日 上午 10:03
  • Hello Uriel,

    I'm new to C++ too, and I've the same problem. It looks like you cannot evaluate functions in C++ because when you try to evaluate a function you are actually trying to inject some code to the running process. However since the code is compiled to binary executable, you won't be able to evaluate the function. Sad

    In interpreted languages this would be easily possible since code can be changed on runtime.

    Please somebody prove that I'm wrong! Smile
    • 已提議為解答 继续独行 2011年10月13日 上午 02:13
    2008年9月21日 下午 02:47