Get Computer Name in mql4 - page 3

 

When I run the GetComputerNameA() function or the ExpandEnvironmentStringsA() it returns nothing for me, just 0.

Does this only work in MQL5?

I can only use MQL4.

Thanks

 
William2050: GetComputerNameA() function or the ExpandEnvironmentStringsA()

Strings have been 16 bit since February 3, 2014 (Build 600)
          Upcoming MetaTrader 4 and MQL4 Upgrades - Big Changes Are Underway (MetaQuotes Software Corp.) - MQL4 and MetaTrader 4 - MQL4 programming forum

 
Masa:

Hi,

I want to get computer name in mql4 in order to make original log file including computer name which MetaTrader runs.

I think it is possible using GetComputerName function in kernel32.dll, but I don't know how to implement it in mql4. I found a kernel32 api example and modified it, but it doesn't work. Can anybody teach me how to use GetComputerName function in mql4?

I tried following code, but terminal says "GetComputerName GBPUSD,H1: cannot call function 'GetComputerName' from dll 'kernel32.dll' (error 127)".

Thank you.

Where shout this function be declared in my program i would like to use it but its giving me errors

 
qjol:
Please help with this code it doesnt work. doesnt show any alert popup? what could i be doing wrong?