zacząłem się bawić w programowanie własnych strategii pod jForex. Zachciało mi się wysyłania maili w trynie Remote Run. W javadoc na dokascopy znalazłem fragment, który miał to umożliwiać niestety kompilator wywala mi błąd,
którego nie umiem zlikwidować.Type mismatch: cannot convert from Object to IEmailResponse
wspomniany fragment kodu:
Kod: Zaznacz cały
try {
// Note: not to hold up the strategy execution, consider calling the sending logic from another thread
Future future = utils.sendMail("to@host.com", "Test mail subject", "Test mail \n Bye.");
console.getOut().println("Waiting on response");
IEmailResponse response = future.get(30, TimeUnit.SECONDS);
if (response.isError()) {
console.getErr().println(response);
} else {
console.getOut().println("e-mail successfully sent!");
}
} catch (Exception e) {
e.printStackTrace(console.getErr());
}
Kod: Zaznacz cały
IEmailResponse response = future.get(30, TimeUnit.SECONDS);
Z góry dzięki.