-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpropmacros.cpp
More file actions
42 lines (38 loc) · 830 Bytes
/
propmacros.cpp
File metadata and controls
42 lines (38 loc) · 830 Bytes
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
#include "propmacros.hpp"
template<class T>
T* alloc(int count) {
return (T*)malloc(sizeof(T) * count);
}
//put object to object
void PutToObject(const wchar_t* name, iTJSDispatch2* data, iTJSDispatch2* inst) {
tTJSVariant i(data);
inst->PropSet(
TJS_MEMBERENSURE,
name,
NULL,
&i,
inst
);
data->Release();
}
//put object to object by num
void PutToObject(int name, iTJSDispatch2* data, iTJSDispatch2* inst) {
tTJSVariant i(data);
inst->PropSetByNum(
TJS_MEMBERENSURE,
(tjs_int)name,
&i,
inst
);
data->Release();
}
tTJSVariant getMember(iTJSDispatch2* dic, const tjs_char* key) {
tTJSVariant r;
dic->PropGet(TJS_MEMBERENSURE, key, NULL, &r, dic);
return r;
}
tTJSVariant getMember(iTJSDispatch2* dic, tjs_int key) {
tTJSVariant r;
dic->PropGetByNum(TJS_MEMBERENSURE, key, &r, dic);
return r;
}