Freigeben über


appobject

Identifies the coclass as an application object, which is associated with a full .exe application, and indicates that the functions and properties of the coclass are globally available in this type library.

Syntax

[appobject]

Hinweise

Das Appobject C++-Attribut weist die gleiche Funktionalität wie das Appobject MIDL-Attribut auf.

Beispiel

Der folgende Code zeigt eine einfache Klassendefinition, die einem Attributblock vorausgeht, der appobject enthält:

// cpp_attr_ref_appobject.cpp
// compile with: /LD
#include <windows.h>
[module(name="MyLib", uuid="f1ce17f0-a5df-4d26-95f6-0a122197ac5b")];

[object, uuid="905de6db-7a12-45ab-9f8b-b39f5112f010"]
__interface ICustom {};

[coclass, appobject,uuid="00395340-745f-4b69-bd58-e2921452b9fc"]
class A : public ICustom {
   int i;
};

Anforderungen

Attributkontext Wert
Gilt für class, struct
Wiederholbar Nein
Erforderliche Attribute coclass
Ungültige Attribute None

Weitere Informationen zu den Attributkontexten finden Sie unter Attributkontexte.

Siehe auch

IDL-Attribute
Klassenattribute
typedef-, enum-, union- und struct-Attribute