Libraries: File Mapping without DLL - page 6

 
TheXpert:
Standard is standard, so there's nothing to go into it, no way. There's an error -- report it to the developers. No other way.

In the standard bible, the call is GetLastError.

but it should be like this ::GetLastError.

Otherwise kernel32::GetLastError is a bug.

How not to correct it?

 
Urain:

How can you not edit it?

I hinted and I showed and I wrote.

#import

int GetLastError(int )

---

and that's it. The context is free.

If you don't want to do it that way, RtlGetLastError is similar.

 
sergeev:

I hinted and I showed and I wrote.

#import

int GetLastError(int )

---

and that's it. The context is free.

If you don't want to do it that way, RtlGetLastError is similar.

Yeah, I understand hints from the first time, only MQ developers also pay attention to us, otherwise they code for no one and then people suffer.
 
sergeev:

don't you want to do it this way - RtlGetLastError - similar

RtlGetLastWin32Error? not similar, you have to reset the error yourself with your hands
 
While applying your classes in my code I came across the following problem: if the shared memory size is larger than 4096 bytes, memcpyX in CMemMapApi::Write / Read (lines 219 and 231 in memmaplib.mqh) shows "Access Violation". Could you please tell me "where to dig" to "make" memcpy read memory blocks larger than 4kb?
[Deleted]  

The author has a great respect for the work done. If the author doesn't mind, I will include these two classes in my SCL class library.

However, there are errors in the classes in terms of defining standard Microsoft types that cause other errors in the algorithm. For example, DWORD type is not int but uint. Because of this, I had to revise some algorithms in the classes, but it was not very difficult.

 

_Konstantin_:

For example, DWORD type is not int, but uint.

bitness is the same. this is enough to call
[Deleted]  
sergeev:
bitness is the same. this is enough for the call
If according to Microsoft, then in methods where DWORD < 0 is a condition, there will be a warning, because DWORD cannot be less than 0. This is not essential of course, especially since you can tweak the logic of some methods. In general, I liked these two classes :)
 
I don't quite understand how thread-safety is implemented? Suppose: several processes write and read at the same time. Logically, there should be something like Lockfile, but I didn't find it in lib. Or is it already implemented at winapi level?
 
Al_key:
I don't quite understand how thread-safety is implemented? Suppose: several processes write and read at the same time. Logically, there should be something like Lockfile, but I didn't find it in lib. Or is it already implemented at winapi level?

lib doesn't have section binding, because theoretically the code can be executed in different processes.

To control it, use either your variant or https://www.mql5.com/en/code/1835.

Mutex - на чистом WinAPI
Mutex - на чистом WinAPI
  • votes: 29
  • 2013.08.20
  • o_O
  • www.mql5.com
Синхронизируем процессы ОС/EA/MT и т.д. Никаких самописных DLL. Настало время держать все под своим контролем!