COM Interface Woes
-
I am dynamically connecting to an unmanaged C++ COM interface using GetTypeFromProgID, but I must get a secondary IDispatch interface by calling the "GetBasicCallInfoIDisp" function of that interface. Using this secondary interface, I am trying to get a simple property. The JavaScript is very rudimentary:
var winoperdoc = new ActiveXObject("WinOper.Document"); var winoper = winoperdoc.GetBasicCallInfoIDisp(); window.alert(winoper.SeizureID);
The C# version I have looks like this:Type objWinOper = Type.GetTypeFromProgID("WinOper.Document"); object objWinOperLateBound = objWinOper.InvokeMember("GetBasicCallInfoIDisp", BindingFlags.CreateInstance, null, objWinOper, new object[]{}); int SeizureID = (int) objWinOper.InvokeMember("SeizureID", BindingFlags.Default | BindingFlags.GetProperty, null, objWinOperLateBound, new object[]{});
This compiles, but I get an "Unknown Name" when I try to get the value from a member property. Any help is appreciated. Cheers, Daaron