and again dll and market - page 9

 
Alexsandr San:

added"apikey:GR1bb3zVMs9fcNKL6pA9-5zads3j9ptWliCu6eh9oupUnpZB9pt"

still an error

I got to this entry.

void OnStart()
  {
   string cookie=NULL,headers;
   char   post[],result[];
   char cost_char_data[];
   string  result_headers;
   
   headers = "Content-Type: application/json";
   
   
   string url="https://api.eu-gb.text-to-speech.watson.cloud.ibm.com/instances/9886a3ce-5734-455f-8f78-7a56381da686/v1/synthesize";
//--- для работы с сервером необходимо добавить URL "https://finance.yahoo.com" 
//--- в список разрешенных URL (Главное меню->Сервис->Настройки, вкладка "Советники"):
//--- обнуляем код последней ошибки
   ResetLastError();
//--- загрузка html-страницы с Yahoo Finance

   int res = WebRequest("POST",url,headers,1000,cost_char_data,result,result_headers);
   if(res==-1)
     {
      Print("Ошибка в WebRequest. Код ошибки  =",GetLastError());
      //--- возможно, URL отсутствует в списке, выводим сообщение о необходимости его добавления
      MessageBox("Необходимо добавить адрес '"+url+"' в список разрешенных URL во вкладке 'Советники'","Ошибка",MB_ICONINFORMATION);
     }
   else
     {
      if(res==200)
        {
         //--- успешная загрузка
         PrintFormat("Файл успешно загружен, размер %d байт.",ArraySize(result));
         //PrintFormat("Заголовки сервера: %s",headers);
         //--- сохраняем данные в файл
         int filehandle=FileOpen("url.htm",FILE_WRITE|FILE_BIN);
         if(filehandle!=INVALID_HANDLE)
           {
            //--- сохраняем содержимое массива result[] в файл
            FileWriteArray(filehandle,result,0,ArraySize(result));
            //--- закрываем файл
            FileClose(filehandle);
           }
         else
            Print("Ошибка в FileOpen. Код ошибки =",GetLastError());
        }
      else
         PrintFormat("Ошибка загрузки '%s', код %d",url,res);
     }
  }

but can't figure out how to pass another pair to the headers line

--header "Accept: audio/wav" ^

and then throw in the query body

--data "{\"text\":\"hello world\"}" ^

--output hello_world.wav ^

 
Alexsandr San:

added"apikey:GR1bb3zVMs9fcNKL6pA9-5zads3j9ptWliCu6eh9oupUnpZB9pt"

still an error

this situation is easily solved )


Next comes the syntax verification and that's a painful thing to do without expert advice

 
Nikolai Karetnikov:

that's adorable again )))) Well, how could you infer from the first post of the thread an intention to bypass something that can't be bypassed. You can't cram the DLL into the Market like you can't cram the toothpaste back into the tube ))

We need some other way to implement the functionality. Now we work with WebRequest.

Just have already had such questions on the forum. Apparently not everyone is sure that this is impossible.


Let's stop this dialog. Claims withdrawn...

 
Nikolai Karetnikov:

this situation is easy to solve )

The next step is syntax verification, and that's a painful one, without expert advice.

Photo by

downloaded the file from here (https://finance.yahoo.com) without problems

Snapshot2

loaded this page

Snapshot3

 
Nikolai Karetnikov:

not aware of it, but of course I'm prepared to abide by the rules and sacrifice another account in favour of the one I'm writing from.

How do I do this?

Write a request to delete your account in Service Desk. The link to Service Desk is in your profile.

 
Alexsandr San:

401

Inheritance from this class is not possible because it is declared with specifier final

I don't know with 401 only found this.

Not a good search. Everything is in the documentation. Modifiers override and final.

Документация по MQL5: Основы языка / Объектно-ориентированное программирование / Виртуальные функции
Документация по MQL5: Основы языка / Объектно-ориентированное программирование / Виртуальные функции
  • www.mql5.com
Ключевое слово virtual служит спецификатором функции, который обеспечивает механизм для динамического выбора на этапе выполнения подходящей функции-члена среди функций базового и производного классов, структуры не могут иметь виртуальных функций. Оно может применяться для изменения объявлений только функций-членов. Виртуальная функция может...
 
Artyom Trishkin:

You're not looking hard enough. It's all in the documentation. Modifiers override and final.

Thank you! I'm just trying to understand what the man is trying to make.

 
Alexsandr San:

downloaded the file from here (https://finance.yahoo.com) without any problems

loaded this page.


Yes it works, I agree, but the response from the server there is a json file in theresult array.

Unfortunately there is no example in the documentation with the server response as a binary file. It's not clear where to put it )

 
Artyom Trishkin:

Write a request to delete your dubious account to Service Desk. The link to Servicedesk is in your profile.

done

 
Artyom Trishkin:

Write a request to delete your dubious account to Service Desk. You can find the Service Desk link in your profile.

Aryom, are there plans to merge accounts?

Reason: