Why am I getting a “member function not present” error when parsing expressions in the VC ++ debugger?

I have a static method, MyClass::myMethod() in another DLL, MyDll.dll . In my code, I call this method, and it compiles and works fine.

But when I try MyClass::myMethod() in the immediate window (or viewport), I always get:

 MyClass::myMethod() CXX0052: Error: member function not present 

Why is this?

Update . I found out that when I use the context operator it works:

 {,,MyDLL}MyClass::myMethod() 

I'm not quite sure why this is necessary, so I'll wait a bit to see if anyone has a good explanation.

Update 2 : I was asked for more information. Unfortunately, I have described almost everything that I have. This is in third-party code. A method that resides in another DLL is declared as follows:

 class MyClass { public: // ... _declspec(dllimport) static const char *getDirectory(void); } 

and it is invoked as follows:

 MyClass::getDirectory () 

I have no source. It was compiled in debug mode in VC ++ 9.

+7
c ++ debugging visual-c ++
source share
2 answers

Well, I'm not sure why, but the debugger is not smart enough to know that the class is in another DLL, so you should explicitly talk about this using the context operator :

 {,,MyDLL}MyClass::myMethod() 
+2
source share

Perhaps because your static function is defined in a string.

My test with this class:

 class myclass { public: static int inlinetest() { return 0; } static int test(); }; int myclass::test() { return 0; } 

gives me this result in my closest window:

 myclass::inlinetest() CXX0052: Error: member function not present myclass::test() 0 
0
source share

All Articles