一直在用vc6做项目可是发现vc6的class view总是有问题
查了一下资料,老外说是class view的一个bug
-----------------------症状--------------------------------
我已经定义了该函数,并且已经实现了,编译也能通过
可是当我使用Go To Definition的功能的时候,死活就是说我没实现
查过资料后知道,原来这是由于typedef xbr XBR
我用XBR定义了一个参数,于是,就出现了上述问题了
----------下面是老外的解答,小抄一下-------------------
VS has some problems with typdef'd stuff when using "Go To Definition." i find that it at times can't even handle very basic typedefs that are equivalent to #defines. but then the next time i go back to the same project it will all be fine.
--------------------------------------------------
另外
------------继续小抄-------------------------------------
This may happen, for example, when function definitions in h and cpp files are slightly different, for example:
void MuFunction(LPCTSTR);
void CMyClass::MyFunction(LPCTSTR s){}
Class Wizard is not so smart as compiler. Sometimes enumeration parameter cause the problem:
enum MyEnum
{
FIRST,
SECOND
};
void MyFunction(MyEnum n);
void CMyClass::MyFunction(MyEnum n){}
In this case such definition can help:
void MyFunction(enum MyEnum n);
void CMyClass::MyFunction(enum MyEnum n){}
However, I still have the cases when Class Wizard cannot find function implementation. It would be interesting to see other replies to your answer.
void MuFunction(LPCTSTR);
void CMyClass::MyFunction(LPCTSTR s){}
Class Wizard is not so smart as compiler. Sometimes enumeration parameter cause the problem:
enum MyEnum
{
FIRST,
SECOND
};
void MyFunction(MyEnum n);
void CMyClass::MyFunction(MyEnum n){}
In this case such definition can help:
void MyFunction(enum MyEnum n);
void CMyClass::MyFunction(enum MyEnum n){}
However, I still have the cases when Class Wizard cannot find function implementation. It would be interesting to see other replies to your answer.
--------------------------------------------------------------------------
还有这样的情况
-------------------------小抄--------------------------------------------
I remember that sometimes VC6 IDE had problems locating
definitions when function's parameters were on different
lines:
// .H file
class X
{
void foo(int a, int b, int c);
};
// .CPP file
void X::foo(
int a,
int b,
int c)
{
...
}
Or something along this example. I never figured out exact
case when it stopped working. If you have an opportunity to
get Visual Assist for VC6, then do it. It will save a _lot_
of hair on your head.
definitions when function's parameters were on different
lines:
// .H file
class X
{
void foo(int a, int b, int c);
};
// .CPP file
void X::foo(
int a,
int b,
int c)
{
...
}
Or something along this example. I never figured out exact
case when it stopped working. If you have an opportunity to
get Visual Assist for VC6, then do it. It will save a _lot_
of hair on your head.
-----------------------------------------------------------------------------------------
这些都能引起不能找到定义