- A) k3 o$ M: W" y: v3 x2.这是request的程序( c/ w7 d2 D2 t; Q0 V- M6 b7 w
// Request a value from Extend6 f- I) P$ f7 F! }7 B
// 6 s5 |( \* M# Y' l// Initialize the variant that will hold the BSTR. Set the variant's , q# E3 L, p K// type flag to indicate the fact that this variant holds a BSTR. Place the 0 x) D' @: d$ }8 i; f// BSTR into the variant structure.2 u- P( _8 k1 c# u3 f8 l
D. }1 e9 M& ~1 f3 ~7 q; M
requestVariant = (VARIANTARG *)malloc(sizeof(VARIANTARG) *2);' y5 @, Q( v/ X, _+ i; w$ r( P
7 E+ r0 v( b- a. s itemStr = SysAllocString((WCHAR *) L"global0:#0:0:0:0:0");0 i. I7 E- Y" y/ B0 y/ n' p
VariantInit(&requestVariant[0]); " o6 |8 q9 K, ]2 n requestVariant[0].vt = VT_BSTR; ( i4 u2 ~0 m- ? requestVariant[0].bstrVal = itemStr; : |. ]6 M) c' x4 g , A! v2 C* r# T9 g, [ topicStr = SysAllocString((WCHAR *) L"system"); 3 \: u8 b0 v8 h/ W VariantInit(&requestVariant[1]); ) D5 o7 p: V% P, b, ^5 q. n$ [ U requestVariant[1].vt = VT_BSTR;$ _0 e/ a: n# Q/ m6 t3 {
requestVariant[1].bstrVal = topicStr;- g% S( t Z% t& A& B. i
! b/ O h! m; k0 t* |$ U// Set the DISPPARAMS structure that holds the variant.( p1 N! m; B1 `) G
! l+ C m0 @. S9 ^- l; ] dp2.rgvarg = requestVariant; 1 o i" ` m1 L9 Z& m dp2.cArgs = 2; : G/ V" Q$ u7 ` dp2.rgdispidNamedArgs = NULL; ( @2 L+ a, B4 p8 T dp2.cNamedArgs = 0; 2 c8 ^1 X& u$ l2 n5 ]; j' }8 K - G9 n9 {2 H) V* _: } var.vt = VT_EMPTY;, s+ H4 g: u U: e6 ]* } Q
) s) _. N& Q4 p2 A5 h8 Z9 B
// Call IDispatch::Invoke(): Z% N5 e4 e2 }
4 g1 e' C5 e" m5 I" M$ h6 M
hr = m_pDisp->Invoke(# g, i, ^) d" X' E
requestID," E" r# X& q; v( ]1 V" I
IID_NULL, 3 F! E0 }+ w$ o' c+ S+ a8 {7 }" V0 R LOCALE_SYSTEM_DEFAULT,. ?1 x; g5 a9 e' Z. u
DISPATCH_METHOD, $ {# J" U2 ]" u; ?) P &dp2,1 e7 W7 K" W$ @) z W; \
&var, + l. t, a4 w; ?5 _( S* G' X &ei,/ H% p: ^$ O6 U1 k" S; `
&uiErr); ) @! d& k0 @$ X! x' [+ T+ b$ H# J0 c& ] J" N* d
SysFreeString(topicStr); ) }) S! {, S7 Z6 t5 B- ` SysFreeString(itemStr);" s& [* l" R1 G# n6 U9 P
请问该程序是获得extend里面的哪个值?8 h* {* y( K8 Y& G4 w: V9 z
如果我希望获得extend程序里面的某个变量的数值,那个c++程序应该如何实现????