-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathaddin_base.cpp
More file actions
57 lines (48 loc) · 1.24 KB
/
Copy pathaddin_base.cpp
File metadata and controls
57 lines (48 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "stdafx.h"
#include "addin_base.h"
namespace {
AppCapabilities g_capabilities = eAppCapabilitiesInvalid;
} // namespace
long GetClassObject(const WCHAR_T* wsName, IComponentBase** pInterface) {
if (!*pInterface) {
stru name{wsName};
for (const AddinInfo* ptr = AddinInfo::first; ptr; ptr = ptr->next) {
if (ptr->name.equal_iu(name)) {
*pInterface = ptr->create();
break;
}
}
return *pInterface != nullptr;
}
return 0;
}
AppCapabilities SetPlatformCapabilities(const AppCapabilities capabilities) {
g_capabilities = capabilities;
return eAppCapabilitiesLast;
}
AttachType GetAttachType() {
return eCanAttachAny;
}
long DestroyObject(IComponentBase** pIntf) {
if (!*pIntf)
return -1;
delete *pIntf;
*pIntf = 0;
return 0;
}
const WCHAR_T* GetClassNames() {
static auto classes = []() {
lstringu<100> classes;
for (AddinInfo* ptr = AddinInfo::first; ptr; ) {
classes += ptr->name;
ptr = ptr->next;
if (ptr) {
classes += u"|";
} else {
break;
}
}
return classes;
}();
return classes;
}