Internet Explorer 拡張機能で合成 Javascript イベントを生成しようとしていますが、fromElement プロパティを保持するのに問題があります。これが私のコードの抜粋です:
MsHtml.IHTMLDocument4 doc4 = ... // the document object
Object o = null;
MsHtml.IHTMLEventObj2 eObj =
(MsHtml.IHTMLEventObj2)doc4.CreateEventObject(ref o);
// string that specifies the from element, e.g. "document.getElementById('id1')":
string locator = ...
object from = doc4.Script.GetType().InvokeMember("eval",
BindingFlags.InvokeMethod,
null,
doc4.Script,
new object[] { locator });
// from now holds a ref to an object that implements the IHTMLElement interface
eObj.fromElement = from;
IHTMLElement el = eObj.fromElement;
// el == null
ここで何が間違っていますか?eObj.fromElement は from と等しいはずですが、設定されていないようです。