Profile Picture

Does RightEdge even support MB trading any more? Need a reply desperately

Posted By waqas 5 Years Ago

Does RightEdge even support MB trading any more? Need a reply...

Message
Posted Thursday September 27 2012
I posted here yesterday about the issue of integrating MB Trading into RightEdge at 9:41 AM. No one even replied. Although one of the moderators did reply on a post regarding IB at 4:23 PM.

If RightEdge does not support MB Trading anymore, please at-least let me know so I can move on in another direction, because right now I am stuck in this issue and don't know which direction to move to.

I will really appreciate your help.

Thanks.

Edited: Thursday September 27 2012 by waqas
Posted Thursday September 27 2012
Hi RightEdge,

Please post reply on the above question... We are working on a project and we want to stop working if this is not achievable.

We will highly appreciate your kind response.

We have been discussing with MB support as well and they have agreed to provide complete help. If you guys can spare sometime we can make the plugin work. And in the end we can give you the DLL and you can add it your product!!!

I hope you will understand our current situation and will reply to it.

Thanks,
Rasheed
Posted Friday September 28 2012
Hi,

Sorry for not responding earlier. The source code to the MB Trading plugin will be included in the next release of RightEdge. I am also attaching it here so you can get started right away.

I've updated the plugin to compile against the latest version of the MBTrading SDK (11.9.0.47). You will need to follow the instructions on the MBT site to avoid DEP crashes. In my limited testing so far, I wasn't able to get any market data after updating to the new API, and I didn't try testing the broker functions. But the source code should at least provide a good start. Let me know if you have any questions.

Thanks,
Daniel

Attachments
MBTradingSource_20120928.zip (289 views, 73.00 KB)
Posted Monday October 01 2012
Thanx for the reply Daniel.

That means you dont get the COM exception when you try to get live data and you have MBT Desktop 11.9.0.47 installed. I was able to get my hands on 11.9.0.48 version of the MBT Desktop and try to get live data using DLL from the source code that you sent. it still throws that COM exception. I have emailed MBT support to know if they will provide me with the previous version required. If you can help in getting me that build, that would be great.

Will keep you posted.

Thanks,
Waqas
Posted Monday October 01 2012
No, I didn't get a COMException. It might be a mismatch between versions though... the source code I posted compiles against version 11.9.0.47. Try removing the 4 references to the MBT APIs from the project (Interop.MBTCOMLib, Interop.MBTHISTLib, Interop.MBTORDERSLib, and Interop.MBTQUOTELib), and then re-adding references to those COM APIs. In the COM tab of the add reference dialog I think they will have names like "MbtCom 2.1 Type Library".

Thanks,
Daniel
Posted Wednesday October 03 2012
Daniel,

I added the MBT Type libraries from from the COM tab, in the source code of the MBT plugin you provided, but still I got the exception. But I think I realize the problem now.

At first when I added the MBT Plugin into the RightEdge Plugins folder, at least RightEdge picked up my plugin DLL.

Then, I replaced the Interop.MBT DLLs already present in the RightEdge plugins folder, with the Interop.MBT DLLs that were built with the MBT source code you provided(using the MBT COM Type libraries). To my surprise, RightEdge didn't even detect that there was any MBT plugin placed in the plugin folder, although there were two plugins present there.

So that means, that the MBT's COM libraries, which are required to get the plugin running, are not compatible with RightEdge. And on the other hand, the Interop.MBT DLLs RightEdge is using are not fit to remove the COM Exception.

I got a reply from MBT support, they state that version 11.9.0.47 and 11.9.0.48 are compatible, there shouldn't be any issue.

You thoughts?

Thanks,
Waqas
Posted Wednesday October 03 2012
By the COM libraries, you mean the Interop.MBTXXX.dll files, right? I'm surprised copying the right versions of those to the plugins folder stopped the plugin from showing up in RightEdge. Can you run RightEdge with a debugger attached and look at the debug output? It should include some information about why the plugin failed to load. It should look something like this:

Scanning D:\RightEdge\src2008\bin\Debug\Plugins\fxClientAPI_2005.dll for plugins...
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
Error loading plugin from D:\RightEdge\src2008\bin\Debug\Plugins\fxClientAPI_2005.dll:
The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at RightEdge.Shared.PluginManager.PluginManagerStub.ScanFile(String filename) in D:\RightEdge\src2008\RightEdge.Shared\PluginManager.cs:line 350

Thanks,
Daniel
Posted Thursday October 04 2012
The COM libraries are the MBTXXX type libraries you suggested. And after they are built with the MBT plugin project, I copied them to the RightEdge plugins folder.

Given that, RightEdge does detect the MBT plugin, but only when I change the target platform to Any CPU, instead of x86.
FYI, I am running a 64-bit machine with Windows 7 installed.

When I choose Any CPU, the exceptions are as follows:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
An exception of type System.BadImageFormatException was thrown.
Could not load file or assembly 'fxClientAPI_2005, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at RightEdge.ServiceLoader.RefreshServices()
Error loading Service: C:\Program Files (x86)\Yye Software\RightEdge 2010\Plugins\fxClientAPI_2005.dll

The COM Exception then follows when the MbtComMgr tries to initialize:

The service plugin MBTrading.MBTTickRetrieval threw an exception of type System.Runtime.InteropServices.COMException
at RightEdge.Shared.ServiceWrapper.DoError(Exception e)
at RightEdge.Shared.ServiceWrapper.Connect(ServiceConnectOptions connectOptions)
at RightEdge.Shared.LiveDataManager.AddService(String serviceName)
at RightEdge.Shared.LiveDataManager.AddSymbols(IEnumerable`1 symbols)
at RightEdge.xfb471916970b0c9e.AddSymbols(IEnumerable`1 symbols)
at RightEdge.xf266856f631ec016.x241715eb000ca8fc()
at RightEdge.xf266856f631ec016.xa927fcc2ce303480(Object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)

Inner Exception:
An exception of type System.Runtime.InteropServices.COMException was thrown.
Retrieving the COM class factory for component with CLSID {31C0BC9B-2250-4964-A582-BA03058BAC93} failed due to the following error: 80040154.
at MBTrading.MBTTickRetrieval.Connect(ServiceConnectOptions connectOptions)
at RightEdge.Shared.ServiceWrapper.Connect(ServiceConnectOptions connectOptions)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

When I build the DLL with target framework x86, the exceptions are:

An exception of type System.BadImageFormatException was thrown.
Could not load file or assembly 'fxClientAPI_2005, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at RightEdge.ServiceLoader.RefreshServices()
Error loading Service: C:\Program Files (x86)\Yye Software\RightEdge 2010\Plugins\fxClientAPI_2005.dll
An exception of type System.BadImageFormatException was thrown.
Could not load file or assembly 'Interop.MBTCOMLib, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at RightEdge.ServiceLoader.RefreshServices()
Error loading Service: C:\Program Files (x86)\Yye Software\RightEdge 2010\Plugins\Interop.MBTCOMLib.dll
An exception of type System.BadImageFormatException was thrown.
Could not load file or assembly 'Interop.MBTORDERSLib, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at RightEdge.ServiceLoader.RefreshServices()
Error loading Service: C:\Program Files (x86)\Yye Software\RightEdge 2010\Plugins\Interop.MBTORDERSLib.dll
An exception of type System.BadImageFormatException was thrown.
Could not load file or assembly 'Interop.MBTQUOTELib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at RightEdge.ServiceLoader.RefreshServices()
Error loading Service: C:\Program Files (x86)\Yye Software\RightEdge 2010\Plugins\Interop.MBTQUOTELib.dll
An exception of type System.BadImageFormatException was thrown.
Could not load file or assembly 'MBTrading, Version=2010.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at RightEdge.ServiceLoader.RefreshServices()
Error loading Service: C:\Program Files (x86)\Yye Software\RightEdge 2010\Plugins\MBTrading.dll
An exception of type System.BadImageFormatException was thrown.
Could not load file or assembly 'fxClientAPI_2005, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at RightEdge.ServiceLoader.RefreshServices()

Edited: Thursday October 04 2012 by waqas
Posted Thursday October 04 2012
The MBT libraries are only compatible with 32-bit processes. On a 64-bit machine, you need to force RightEdge to run in 32-bit mode to use the MBT plugin. To do this, run the Force32Bit.bat in the RightEdge installation directory from an admin command prompt. Then compile the plugin for x86.

That should at least get the plugin loading correctly.

Thanks,
Daniel
Posted Tuesday October 09 2012
Thanks Daniel,

The solution worked as now the DLL targets 32 bit and gets loaded fine into RightEdge and no COM Exception anymore.

But now there is another issue. When I subscribe for Live data, as soon as the logon successful confirmation arrives, RightEdge crashes. When I debugged, the exception is the same as you mentioned once:

An exception of type System.IO.FileNotFoundException was thrown.
The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at RightEdge.ServiceLoader.RefreshServices()
Error loading Service: C:\Program Files (x86)\Yye Software\RightEdge 2010\Plugins\fxClientAPI_2005.dll

As I have told earlier I have forced RightEdge to run 32 bit. Any help?

Thanks,
Waqas


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems