6 K4 A4 u, y/ x! s; F: ?+ b2.这是request的程序 9 j: q' F* p1 u' l9 P3 h* t- P; j// Request a value from Extend , l2 N# O$ E7 A4 X# V// 2 p$ H) ?4 P8 T// Initialize the variant that will hold the BSTR. Set the variant's 4 R3 W: ]7 B; W6 S// type flag to indicate the fact that this variant holds a BSTR. Place the - b$ q& E1 B x: F! g// BSTR into the variant structure., G% z- l6 D/ o" N2 @- ?
% M+ P7 l( P4 A8 `$ y
requestVariant = (VARIANTARG *)malloc(sizeof(VARIANTARG) *2);8 y! X8 { c/ j+ W
. Z5 p2 @* @& i itemStr = SysAllocString((WCHAR *) L"global0:#0:0:0:0:0"); ; a$ y1 W a( i4 G% s5 Q: X8 W% `( i VariantInit(&requestVariant[0]); 7 y* ^" S; i( r; _# d
requestVariant[0].vt = VT_BSTR; ; r; y2 F( z7 ?6 V requestVariant[0].bstrVal = itemStr;8 b. \' [1 d4 e6 ]3 _' \
! C Z% ^3 q, D- w/ H- T/ G
topicStr = SysAllocString((WCHAR *) L"system");& P' }; Y( l- k7 C( _
VariantInit(&requestVariant[1]); 1 w( P! w! J( h- h5 N8 C7 R requestVariant[1].vt = VT_BSTR;$ g2 y, p5 l& n. z
requestVariant[1].bstrVal = topicStr;. q' y P1 H* b; ]; q
$ B: q2 L. j) A4 ~! K! y// Set the DISPPARAMS structure that holds the variant. - {: j0 @' h: a; M $ a. e" e+ g1 w dp2.rgvarg = requestVariant;+ W* |5 q, @6 \- y5 g
dp2.cArgs = 2; & x, e6 O1 E0 Y7 U0 C4 Q dp2.rgdispidNamedArgs = NULL; . t' e; h- S" h! |4 m$ }6 q+ b dp2.cNamedArgs = 0;& | D, L2 c3 U
% ~$ l! p* D3 t% M5 V C! s$ ~
var.vt = VT_EMPTY; ( }" z2 @- \. x, b/ c* Z% ~2 t0 i8 a
// Call IDispatch::Invoke() 5 D4 N8 M9 P) H3 j9 M, ?: L & z5 j3 @0 l3 R' N3 F/ g hr = m_pDisp->Invoke( 1 q: L0 m; P) c+ l requestID,9 w0 N$ x1 s/ Y' c
IID_NULL, 2 h; d# s9 L4 Y _/ h7 @ LOCALE_SYSTEM_DEFAULT, ; W- s9 q0 q, z$ ]. C3 c) } DISPATCH_METHOD, 3 F6 ?( ^1 H; E/ W B &dp2,4 o" E3 @/ G5 A% F8 ]# O# p
&var, & n0 g T5 R1 _4 R# r &ei, ) F: i5 @8 J/ h5 R, | &uiErr);# c# {6 p* c7 D4 Z& t! @2 f' O. j" Y
, e2 O2 B4 D9 }1 H SysFreeString(topicStr);) a, g; A* X ]5 Y* X# w
SysFreeString(itemStr); ' ]" U3 G/ Q7 K, q8 `6 D请问该程序是获得extend里面的哪个值? 5 L( x& F. v% t如果我希望获得extend程序里面的某个变量的数值,那个c++程序应该如何实现????