PDA

View Full Version : Error loading DLL in Vertex Bridge LP API Tester



AlgoNaute
03-29-2012, 09:13 PM
Hi Hybrid,

I am trying to write an API for Fx Vertex Bridge LP.

I have create a C# librairies project in Visual Studio 2008. I have added VertexFXBridgeLPAPI.dll in my references.

I have created a class named LP and the class is derived from VertexFXLP. I have overrided all functions and my project is building. For now the functions are empty.

My dll created has a name that begins by "VPX".

I start the Vertex Bridge LP API Tester and load the dll. I get the following error: "Could not load or invalid LP Reference".

Would you know possible reasons for that?

Many thanks and regards,
Nicolas Vitale

Yousef-HS
04-01-2012, 07:09 AM
Hello Nicolas,


From your post, I witnessed that the name prefix of his DLL is incorrect; We mentioned at Bridge API help page that the name prefix is "VFX" and not "VPX" (You may refer to related topic by Clicking Here (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2041/161/vertexfx-bridge-lp-api-introduction). Please re-do the steps again with the name prefix of "VFX" then retry testing the DLL.

You also may refer to VertexFX Birdge LP API Documentation Index by Clicking Here (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2214/161/vertexfx-bridge-lp-api-help-index)

AlgoNaute
04-01-2012, 09:28 AM
Hello,

thank your for your assistance.

I mispelled the prefix writing the message. My DLL had the good prefix VFX.
My .NET version is 3.5. Can it explain the issues?

Thanks and regards,
Nicolas

Yousef-HS
04-01-2012, 12:58 PM
As we never tested this on previous versions of .NET Framework, I suggest upgrading your .NET Framework to 4 then update us. Note that we tried from our end the exact procedure using the default DLL sample and we were able to load it successfully.

AlgoNaute
04-01-2012, 10:12 PM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VertexFXBridgeLPAPI;

namespace VFXAlphaLMAXBridge
{
public class LP : VertexFXLP
{

public LP()
: base("Your Description ", false)
{
}

public override bool ValidateParameter(string Parameter, string Value)
{
switch (Parameter)
{
case "login":
return Value != "";

case "password":
return Value != "";

/*case "Server":
return Value != "";

case "Port":
return Value != "" && (int.Parse(Value)!=0);*/
}
return true;
}

public override void Initialize()
{

}

public override TransResult Connect()
{
return new TransResult(true, "");
}

public override TransResult Disconnect()
{
return new TransResult(true, "");
}

public override TransResult NewLimitOrder(LimitOrderType LOType, double Amount, string LPSymbolName, double Price, string LPAccountID, string BOOrderID)
{
return new TransResult(true, "");
}

public override TransResult NewMarketOrder(OperationType BuySell, double Amount, string LPSymbolName, string LPAccountID, string BOOrderID)
{
return new TransResult(true, "");
}

public override LPSymbol Symbol(int Index)
{
return new LPSymbol("", 0, 0);
}

public override LPSymbol Symbol(string Name)
{
return new LPSymbol("", 0, 0);
}

public override long SymbolsCount()
{
return 0;
}

}
}

Yousef-HS
04-03-2012, 11:07 AM
Hello Nicolas,

As per of your code, the constructor should be public and should not have parameters, please review the below code,



public LP()
: base( "Your Description ", false)
{

Then continue building your DLL and continue the rest of the steps mentioned at Bridge API Help Page. (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2190)

AlgoNaute
04-03-2012, 07:57 PM
Thank you a lot for your help, but I still get the issue.

Would it not be possible to test this empty class and put on the forum a version that is working for sure?

It will probably be very easy for you.

Thanks a lot.
Nicolas

Yousef-HS
04-05-2012, 08:01 AM
Nicolas,

You need is to build your own .NET Class Library project, with Assembly name prefix VFX from project properties. The project should have class name LP inherited from VertexFXBridgeLPAPI.VertexFXLP. Make sure you have done the stated step and let us know the result.

Because the LP Tester was made under a different .NET Frame work, the error may occur and that the DLL could load in the bridge but not in the Tester. I suggest downloading the LP API again and re-install it. It should fix the problem you are experiencing.

Best of luck.

Thank you.

AlgoNaute
04-05-2012, 08:21 AM
Yousef, you can see in the code above that the class name is LP and inherits from VertexFXLP...
As per assembly name, yes I have VFX as assembly prefix as stated in message 3 of this topic.
I can send you my solution if you want.

Yousef-HS
04-05-2012, 09:13 AM
Hello,

Because the LP Tester was made under a different .NET Frame work, the error may occur and that the DLL could load in the bridge but not in the Tester. I suggest downloading the LP API again and re-install it. It should fix the problem you are experiencing.

Let me know how it goes.

AlgoNaute
04-11-2012, 02:22 PM
Thanks Yousef. DLL is loading now so the issue has been solved by your last version.

Yousef-HS
04-12-2012, 08:59 AM
I'm glad everything is working now as should be. Best of luck in your project and don't hesitate to start a new thread if you need any further assistance.