Quantcast
Channel: reflection challenges
Viewing all articles
Browse latest Browse all 2

reflection challenges

0
0
i am trying to recode the following in c# using reflection.
AB = new ActiveXObject("Broker.Application"); 
AB.Commentary.LoadFormula("C:\\Program Files\\AmiBroker\\AFL\\MACD_c.afl"); 
AB.Commentary.Apply(); 
AB.Commentary.Save("Test.txt"); 
AB.Commentary.SaveFormula("MACDTest.afl"); 




the following is the equavannt in c#.

 object activedoc = brokerType.InvokeMember("ActiveDocument", BindingFlags.GetProperty, null, brokerObject, null);
            string symbol = (string)brokerType.InvokeMember("Name", BindingFlags.GetProperty, null, activedoc, null);

            object commentary = brokerType.InvokeMember("Commentary", BindingFlags.GetProperty, null, brokerObject, null);
/* THIS FOLLOWING LINE IS WHERE I GET ERRORS 
it is supposed to be equavalent of AB.Commentary.LoadFormula("C:\\temp\\date.afl"); 
*/
           brokerType.InvokeMember("LoadFormula", BindingFlags.GetProperty, null, activedoc, new object[] { @"c:\temp\date.afl" });


i get the errors {"Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))"}
dunno where to start troubleshooting


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images