I google the parameter type Byte is 0-255 in mql4 we use uchar.so I rewrite my code like this
#import "GetDiskSerial.dll" string GetSerialNumber(uchar); #import //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void OnStart() { MessageBox(GetSerialNumber(0)); }
It worked no error come but the result is unreadable like this "?X??????"
what is wrong ?
I google the parameter type Byte is 0-255 in mql4 we use uchar.so I rewrite my code like this
It worked no error come but the result is unreadable like this "?X??????"
what is wrong ?
You can't use the "GetSerialNumber" function because it returns a pointer to a char and MQL4 is not compatible with this method.
Import "GetDriveInfo" instead.
I got this script in mql4 ex4 format only. It could help you if you only want to see the HDD serial or send it to your clients for licensing purpose.
I did a lot of searching and coding to include it in the code to verify the serial number to let the EA to work or block it, but didn't succeed yet :(
I got this script in mql4 ex4 format only. It could help you if you only want to see the HDD serial or send it to your clients for licensing purpose.
I did a lot of searching and coding to include it in the code to verify the serial number to let the EA to work or block it, but didn't succeed yet :(
You can't get it as you need Admin.-rights to get this info!
It's a Windows problem. After Win XP they decided that this serial number has to protected!!
Well I do get something: 000092F2D1ED (12 char) but this is not the "Hard Drive Uniqe ID" which should be (in my case): S1SXNSAF908244V (15 char).
Everything else works perfectly.
Well I do get something: 000092F2D1ED (12 char) but this is not the "Hard Drive Uniqe ID" which should be (in my case): S1SXNSAF908244V (15 char).
Everything else works perfectly.
I looked at "Volume Serial Number" -- see screenshot below:
I looked at "Volume Serial Number" -- see screenshot below:
What you show seem to be Windows' partition ID not the (hardware's) volume serial number.
Starting the Hardware ID extractor as user I get:
Now after this program has been started with admin-rights i get:
This is what your EA printed:
2015.10.25 10:40:29.410 Sampe02_GetDiskSerialNumber_EA EURUSD,M1: initialized 2015.10.25 10:40:19.095 Sampe02_GetDiskSerialNumber_EA EURUSD,M1: Hard Drive Unique ID: 31535853534e4641303932383434205620202020 2015.10.25 10:40:17.000 Sampe02_GetDiskSerialNumber_EA EURUSD,M1: Partition ID: 92F2-D1ED 2015.10.25 10:40:14.667 Sampe02_GetDiskSerialNumber_EA EURUSD,M1: TestFox: The quick brown fox jumps over the lazy dog. 2015.10.25 10:40:02.672 Sampe02_GetDiskSerialNumber_EA EURUSD,M1: GetDiskSerialNumber.dll Checksum Add(1 + 25) = 26 2015.10.25 10:39:43.305 Expert Sampe02_GetDiskSerialNumber_EA EURUSD,M1: loaded successfully
I have Win 7, 64 and a SSD-Hd! I read somewhere: Until XP Windows has allowed this access!
In the DOS-Box I have - as user (and as admin):
I have posted a question about this in a German Windows-server forum. I'll let you know, we'll see.C:\Windows\system32>dir/p/w Volume in drive C has no label. Volume Serial Number is 92F2-D1ED
I have posted a question about this in a German Windows-server forum. I'll let you know, we'll see.
Let me add that Samsung's Magician (it comes with the hd and has to be started by the Admin.) shows this as SerialNo.: S1SXNSAF098244V so this number I should get.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am trying to use GetDiskSerial.dll in mql4 to get HDD serail num.
my code in mt4 like this
but i got ritical error when I run this script
and error in the log like this
2015.10.19 20:18:58.133 test USDJPY,H1: stack damaged, check DLL function call in 'test.mq4' (30,28)
I know it is the parameter I passed is not good, but I do not know how to make it correct.
anyone know the right way to code this ?