Nuta
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować się zalogować lub zmienić katalog.
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować zmienić katalogi.
"type": nieprawidłowy typ zwracany przez automatyzację; gdy parametr jest oznaczony jako "retval", zwracany typ musi mieć wartość "void", "HRESULT" lub "SCODE"
Uwagi
Metoda w interfejsie COM musi zwrócić wartość void lub HRESULT.
Example
Poniższy przykład generuje kod C3509:
// C3509.cpp
#define _ATL_DEBUG_QI
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define STRICT
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif
#define _ATL_ATTRIBUTES 1
#include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
#include <atlctl.h>
#include <atlstr.h>
[module(name=oso)];
[dispinterface, uuid(00000000-0000-0000-0000-000000000001)]
__interface I {
[id(1)] int f([out, retval] int*); // C3509
// try the following line instead
// [id(1)] void f([out, retval] int*);
};
[coclass, uuid(00000000-0000-0000-0000-000000000002)]
struct C : I {
int f(int*) {
// try the following line instead, and delete return statement
// void f(int*) {
return 0;
}
};
int main() {
}