In MQL5 there is always room for an exploit ! ;) - page 5

 
sergeev:

I don't think so. You can't push megabytes of information through OBJ_TEXT.

the closest candidate is resources

Note: a point is actually a structure packed with variables of different types. It is saved when you close/open the terminal and also saved in a template.

 
DC2008:

Note: a point is actually a structure packed with variables of different types. It is saved when you close/open the terminal and is also saved in the template.

?
 
sergeev:

I keep asking, have you found a solution for DLL 32/64 yet?

There's some kind of WOW32reg.exe in the system (\System32\). I went around and around, it doesn't respond to -h -?, I couldn't register anything blindly.

Google is silent too, I couldn't find anything on microsoft.com... so it's pretty cool.

 
sergeev:
?

What's not clear? Give me a concrete task, but it's all a roundabout way...?

 
MetaDriver:

I keep asking, have you found a solution for DLL 32/64 yet?

There's some kind of WOW32reg.exe in the system (\System32\). I went around and around, it doesn't respond to -h -?, I couldn't register anything blindly.

Google is silent too, I couldn't find anything on microsoft.com... in general, it's acute.

So, just an idea, I haven't tried it myself. After detecting the bit depth of the terminal, use LoadLibrary to dynamically load the DLL.

 
MetaDriver:

I keep asking, have you already found a solution for DLL 32/64 ?

What's the problem here?

In import you specify two identical functions, only with different parameters (int/long). In the program, depending on the 32/64 bit, you call the corresponding function.

 
MetaDriver:

I keep asking, have you already found a solution for DLL 32/64 ?

The code for calling functions from the wind's ones (when passing pointers to them) - found.

Thanks to context :: everything is solved neatly.


Yurich:

In import you specify two identical functions, only with different parameters (int/long). In the program, depending on the 32/64 bit, you call the corresponding function.


E.g. like this:

#import "MemMap32.dll"
int MemRead(HANDLE32 hmem, int &v[], int pos, int sz, int &err); // чтение вектора v с указанной позиции pos размером sz
#import "MemMap64.dll"
int MemRead(HANDLE64 hmem, int &v[], int pos, int sz, int &err); // чтение вектора v с указанной позиции pos размером sz
#import

// переопределяем вызовы для контроля битности
int MemRead(HANDLE64 h, int &v[], int pos, int sz, int &error) { if (_IsX64) return(MemMap64::MemRead(h, v, pos, sz, error)); return(MemMap32::MemRead((HANDLE32)h, v, pos, sz, error));  }
in a code you call with explicit :: context.

::MemRead(...)


That is, we don't multiply function names, but make autodetection of bit rate and call the correct imported one.

 
MetaDriver:

I keep wondering, have you already found a solution for 32/64 DLL?

The easiest way is to put x32 and x64 DLLs of the same name into different Windows system directories - SysWOW64 and System32, respectively.

But inter-program data exchange is really a problem, especially if you address it haphazardly.
So probably reasoned and Microsoft, when in the nineties of last century, went from a file, stream exchange for object - OLE from it to ActiveX -> COM -> COM + -> .NET, ie based on a technology of inter-program exchange have created a new system of programming and code execution.

 
Yurich:

What's the problem here?

In import you specify two identical functions, only with different parameters (int/long). In the program, you call the appropriate function depending on the bit size of 32/64.

It doesn't want to load the 32-bit one at all, and it doesn't want to run the program even if I'm not going to call it (the dll) already.

If"Allow use of DLL" is unchecked, [OK] button is not displayed at all, only canceled. Allow, click OK - the program crashes. Deadlock.

2013.12.19 17:43:20.657 TestFFTdll      'E:\Programs\MetaQuotes_MT5\MQL5\Libraries\fft32.dll' is not 64-bit version


Ideally, I would like to be able to call dll32 in the x64 terminal. I know for sure that it is theoretically possible, but I don't know how.

Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация о запущенной MQL5-программе
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация о запущенной MQL5-программе
  • www.mql5.com
Стандартные константы, перечисления и структуры / Состояние окружения / Информация о запущенной MQL5-программе - Документация по MQL5
 
MetaDriver:

It doesn't want to load the 32-bit one at all, and it doesn't want to run the program even if I'm not going to call it (dll) anymore.

When"Allow dll" is unchecked, [OK] button is not displayed at all, only cancel. Allow, click OK - the program crashes. Deadlock.


Ideally, I would like to be able to call dll32 in the x64 terminal. I know for sure that it is theoretically possible, but I don't know how.

I've just checked it:
2013.12.19 18:49:01.437    do (EURUSD,H1)    TEST
2013.12.19 18:49:01.436    do (EURUSD,H1)    Cannot load 'E:\MT5_REV1\Client\MetaTrader5Terminal\Final\MQL5\Libraries\test.dll'
2013.12.19 18:48:58.929    do    'E:\MT5_REV1\Client\MetaTrader5Terminal\Final\MQL5\Libraries\test.dll' is not 64-bit version
The library is not loaded, but everything works until its function is called (TEST output);

Now we call function of such library:
2013.12.19 18:51:07.446    do (EURUSD,H1)    unresolved import function call
2013.12.19 18:51:07.446    do (EURUSD,H1)    Cannot call 'fnCrashTest', 'test.dll' is not loaded
2013.12.19 18:51:07.445    do (EURUSD,H1)    Cannot load 'E:\MT5_REV1\Client\MetaTrader5Terminal\Final\MQL5\Libraries\test.dll'
2013.12.19 18:51:05.107    do    'E:\MT5_REV1\Client\MetaTrader5Terminal\Final\MQL5\Libraries\test.dll' is not 64-bit version