Reputation: 5220
I've got a static method, MyClass::myMethod()
on another DLL, MyDll.dll
. In my code, I call this method, and it compiles and runs fine.
But when I try MyClass::myMethod()
in the immediate window (or the watch window), I always get:
MyClass::myMethod()
CXX0052: Error: member function not present
Why is that?
Update: I've found out that when I use the context operator it works:
{,,MyDLL}MyClass::myMethod()
I'm not really sure why it's needed, though, so I'm going to wait a bit to see if someone has a nice explanation.
Update 2: I was asked to give more information. Unfortunately, what I described is almost all I have. This is in third-party code. The method, which resides on a different DLL, is declared like this:
class MyClass
{
public:
// ...
_declspec(dllimport) static const char *getDirectory(void);
}
and it is invoked like this:
MyClass::getDirectory ()
I haven't got the source. It was compiled on Debug mode under VC++9.
Upvotes: 7
Views: 4651
Reputation: 5220
Well, I'm not sure why, but the debugger isn't smart enough to know that class is in another DLL, so you have to explictly tell it by using the context operator:
{,,MyDLL}MyClass::myMethod()
Upvotes: 2
Reputation: 8372
That's probably because your static function is defined inline.
My test with this class:
class myclass
{
public:
static int inlinetest()
{
return 0;
}
static int test();
};
int myclass::test()
{
return 0;
}
gives me this output in my immediate window:
myclass::inlinetest()
CXX0052: Error: member function not present
myclass::test()
0
Upvotes: 0