Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Dll usage from strategies
 Post subject: Dll usage from strategies Post rating: 0   New post Posted: Wed 08 Jan, 2014, 13:06 

User rating: 1
Joined: Mon 16 Jul, 2012, 04:14
Posts: 31
Today there was support for loading DLL?
Publish, please working example. If such support is not available, please inform on the state of development.


 
The Best Answer  Post subject: Re: lite DLL Support of jforex platform Post rating: 1   New post Posted: Wed 08 Jan, 2014, 14:51 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6078
You don't need any specific "platform support". Consider using jna, for instance:
@RequiresFullAccess
@Library("c:/temp/jna.jar")
public class StratMsgBoxJna implements IStrategy {

    public interface User32 extends com.sun.jna.Library {
        int MessageBoxA(int hwnd, String text, String caption, int flags);
        public int GetSystemMetrics(int nIndex);
    }

    @Override
    public void onStart(IContext context) throws JFException {
        User32 user32 = (User32) Native.loadLibrary("user32", User32.class);
        user32.MessageBoxA(0, "Hello JForex Strategy", "Test string from JForex Strategy", 1);
        context.getConsole().getOut().println("Screen resolution: " + user32.GetSystemMetrics(1) + " x " + user32.GetSystemMetrics(0));
    }


Attachments:
StratMsgBoxJna.java [1.17 KiB]
Downloaded 532 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: lite DLL Support of jforex platform Post rating: 1   New post Posted: Sat 11 Jan, 2014, 16:19 

User rating: 1
Joined: Mon 16 Jul, 2012, 04:14
Posts: 31
Thank you. Successfully loaded my DLL. Appropriate to make a few remarks.
1. You can load only 64-bit DLLs.
2. I was not able to determine the path where to place the file DLL.
3. I put my DLL file in the directory "C: \ windows \ system32".


 
 Post subject: Re: lite DLL Support of jforex platform Post rating: 0   New post Posted: Tue 14 Jan, 2014, 08:30 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6078
ASLOG2002 wrote:
1. You can load only 64-bit DLLs.
Dll bits should match the one of your Java jre bits.
ASLOG2002 wrote:
2. I was not able to determine the path where to place the file DLL.
3. I put my DLL file in the directory "C: \ windows \ system32".
Did you try System.setProperty("jna.library.path", "c:\\temp\\myDlls");? See more after the line "Make your target library available to your Java program." in the Getting Started article.


 
 Post subject: Re: Dll usage from strategies Post rating: 0   New post Posted: Wed 15 Jan, 2014, 18:57 

User rating: 1
Joined: Mon 16 Jul, 2012, 04:14
Posts: 31
Thank you for your attention. I necessarily use a hint.


 

Jump to:  

cron
  © 1998-2011 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com