error C2440: 'type cast' : cannot convert from 'struct IDispatch *' to 'class CsgGrid'
No constructor could take the source type, or constructor overload resolution was ambiguous
我想是不是要在改cpp文件头少了一个头文件?
谢谢
No constructor could take the source type, or constructor overload resolution was ambiguous
我想是不是要在改cpp文件头少了一个头文件?
谢谢
struct MyStruct;MyStruct get_c1();struct MyStruct
{
int i;
static MyStruct get_C2();
};MyStruct get_C3();typedef MyStruct (*FC)();FC fc1 = &get_c1; // C2440, line 15
FC fc2 = &MyStruct::get_C2; // C2440, line 16
FC fc3 = &get_C3;class CMyClass {
public:
explicit CMyClass( int iBar)
throw() {
} static CMyClass get_c2();
};int main() { CMyClass myclass = 2; // C2440
// try one of the following
// CMyClass myclass(2);
// CMyClass myclass = (CMyClass)2; int *i;
float j;
j = (float)i; // C2440, cannot cast from pointer to int to float
}
CsgGrid CsgColumns::GetGrid()
{
LPDISPATCH pDispatch;
InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&pDispatch, NULL);
return CsgGrid(pDispatch);
}
上面的问题