i just downloaded the latest h changes and there are some new folders _MT. whats the difference between the regular version and this one?
solved: see here and here
[H] what is /MT? Topic is solved
[H] what is /MT?
Last edited by swagfag on 16 May 2019, 19:08, edited 1 time in total.
Re: [H] what is /MT?
When compiling source code there are 2 options: /MD and /MT.
In the past AHK_H used /MD which means that the dll was not included in the exe, that's why you had to distribute vcruntime140.dll with your exe. Around 2 months ago (you can check on GitHub) HotKeyIt changed it to /MT which means that you do not need to distribute the dll with your exe.
There are pros and cons about this but you are free to compile with /MD if you want.
In the past AHK_H used /MD which means that the dll was not included in the exe, that's why you had to distribute vcruntime140.dll with your exe. Around 2 months ago (you can check on GitHub) HotKeyIt changed it to /MT which means that you do not need to distribute the dll with your exe.
There are pros and cons about this but you are free to compile with /MD if you want.
Re: [H] what is /MT?
what pros and cons
Re: [H] what is /MT?
/MD Pros:
/MT Pros:
- The exe is smaller.
- The dll is exposed to updates.
- You need to distribute the dll with the exe.
- If a dll is updated it might break your app.
/MT Pros:
- You don't need to distribute the dll with the exe.
- The exe is bigger.
The Dll is not exposed to updates so if it needs to be updated you need to recompile the source.
Re: [H] what is /MT? Topic is solved
The most important difference is that MD will allow to modify/delete/create memory from dll in exe, exe in dll and dll in dll, where MT version it is very likely to cause memory leaks and will crash your program.
So when you don't use dll, MT version will be fine. Otherwise I would always use MD version!!!
Also MD version will use less memory when dll is used. https://social.msdn.microsoft.com/Forum ... um=msbuild
So when you don't use dll, MT version will be fine. Otherwise I would always use MD version!!!
Also MD version will use less memory when dll is used. https://social.msdn.microsoft.com/Forum ... um=msbuild
Re: [H] what is /MT?
ok, so u cant use AhkThread(), for example, with /MT
thanks @kyuuuri and @HotKeyIt
thanks @kyuuuri and @HotKeyIt
Re: [H] what is /MT?
You can use it but best is not to manipulate memory of another thread!
Re: [H] what is /MT?
"not manipulate the memory of another thread" in what way?
Re: [H] what is /MT?
Does this include Critical Objects?
Re: [H] what is /MT?
im sorry i dont understand what u mean by "Writing/Deleting/Allocation!". are u talking about the MemoryModule? are u talking about using getvar/assign from the main script on the thread script? are u talking about VarSetCapacity? that allocates memory.
are u talking about calling eg VirtualAlloc from the thread script or something?
are u talking about calling eg VirtualAlloc from the thread script or something?
Re: [H] what is /MT?
CriticalObject will most likely cause problems.
MemoryModule and getvar/assign will not cause problems.
The problem is internal memory allocation including VirtualAlloc, HeapAlloc...
MemoryModule and getvar/assign will not cause problems.
The problem is internal memory allocation including VirtualAlloc, HeapAlloc...
Re: [H] what is /MT?
ok thanks, i understand now
Re: [H] what is /MT?
Hello, have 2 questions:
What you said is true only for /MT right?
And, when using /MD is Critical Object the right way to share a variable for loops Like for example writing/reading to it every 20ms?
Or is there a more reliable / better / proper way to do this using HeapAlloc, VirtualAlloc, etc.?
Thank you.
Re: [H] what is /MT?
In MD Version you can use CriticalObject as much and as often as you like, it won't cause memory leaks and it is a fast + easy way to share data
Re: [H] what is /MT?
well, i'd rather use the MT version in my organisation cause many computers dont have vc_redist or have problem with it,
and therefore its causes scripts (complex programs) not to work at all.
but im afraid it will cause memory leaks and crashing...
dilemma...
and therefore its causes scripts (complex programs) not to work at all.
but im afraid it will cause memory leaks and crashing...
dilemma...
Re: [H] what is /MT?
Why can't you save the vcruntime140.dll in the same folder where AHK_H.exe is? That is all you need to use MD version.
Re: [H] what is /MT?
the vcruntime140.dll saved in the same folder where the AHK_H.exe is,
but It does not help in all cases.
In many cases its popup an error msg that "api-ms-win-crt-runtime-l1-1-0.dll is missing",
and when i copy this file separately to the pc then the error msg changed to "api-ms-win-crt-runtime-l1-1-0.dll is corrupted"
only installation of vc_redist or using the MT version instead solve this problem.
Re: [H] what is /MT?
That never happened to me. Where did you get the dll from? Did you download it from those weird "download missing dlls" sites?
Also when this happens, can you calculate the hash of both (the one you use as original and the copy you distributed)?
If they are not different then there is a bug in ahk_h
Also when this happens, can you calculate the hash of both (the one you use as original and the copy you distributed)?
If they are not different then there is a bug in ahk_h
Who is online
Users browsing this forum: No registered users and 5 guests