Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Skype Control Library - Library for MetaTrader 5 | MT5 EA Download - MetaTrader 5 Resources

author EAcpu | 4 reads | 0 comments |

Skype Control Library - library for MetaTrader 5

Skype Control Library - library for MetaTrader 5

Skype Control Library - library for MetaTrader 5

Skype Control Library - library for MetaTrader 5

Skype Control Library - library for MetaTrader 5

Skype Control Library - library for MetaTrader 5

Skype Control Library - library for MetaTrader 5

In automated transactions Skype can be used to send text messages containing necessary information. In this case, cooperation with Skype is implemented through the library Skype4COM , which stands for Access ActiveX Component Program Management.

Currently the Skype4COM .dll is distributed with Skype and by default it is located in the following folder:

For x86 operating systems:

c:\Program Files\Common Files\Skype\Skype4COM.dll

For x64 operating systems:

c:\Program Files (x86)\Common Files\Skype\Skype4COM.dll

This SkypeMQL.dll library file must be installed in the folder: [terminal directory]\MQL5\Libraries

This project only supports the 32-bit version of MetaTrader 4/5.

1. Send instant message

 Integer skype send instant message W( string skype_name, string message, integer position); integer skype send instant message A( string skype_name, string message, integer position); // For MetaTrader 4

There are several tests in the function before sending the instant message:

List of network status constants:

To set multiple allowed states at the same time, use bitwise addition of a constant, for example: STATUS_ONLINE | STATUS_OUT.

The maximum length of an instant message is about 8000 ANSI symbols and about 4000 Unicode symbols.

Code example:

 stringInpSkype name = "Echo 123" ; //Skype name
StringInpTextMessage = "Hello :)" ; // SMS

String MSG;
ENUM_SKYPE_ERROR err=(ENUM_SKYPE_ERROR)SkypeSendInstantMessageW(InpSkypeName,InpTextMessage,STATUS_ONLINE|STATUS_AWAY); if (err==ERROR_NO_ERRORS) message= String format ( "Sent instant message to %s, %s" ,InpSkypeName,InpTextMessage); other MSG = string format ( "An error occurred while sending IM to %s, error: %s" ,InpSkype Name, enumeration to string (error)); print (message);

 

2. Send SMS

There is currently a charge for sending text messages!

 Integer Skype send SMS W( string phone number, string message); Integer Skype send SMS A( string phone number, string message); // For MetaTrader 4

There are several tests before sending a text message:

Sending a text message to a number that doesn't exist is not an error. The cost of this operation will be charged, but will be returned in a short time because the actual message is not delivered.

SMS messages are limited to 116 ANSI symbols, 58 Unicode symbols.

Code example:

Enter stringInp phone number = "+380123456789" ; // phone number
Input stringInpTextMessage = "Hello :)" ; // SMS

String MSG;
ENUM_SKYPE_ERROR err==(ENUM_SKYPE_ERROR) SkypeSendSmsMessageW(InpPhoneNumber,InpTextMessage); if (err==ERROR_NO_ERRORS) message = string format ( "Sent message to %s, %s" ,InpPhoneNumber,InpTextMessage); else MSG = string format ( "To %s An error occurred while sending a text message, error: %s” ,Inp phone number, enumeration to string (error)); print (message);



3. Return value description

Both functions return an integer value that can be analyzed if necessary.

4. First startup

When connecting MetaTrader 5 to Skype for the first time, a pop-up window will appear enabling program management access.

Skype Control Library - library for MetaTrader 5

After confirming access to Skype, the request process goes to the list stored in the program settings: Tools -> Options -> Advanced -> Manage access to Skype from other programs.

Skype Control Library - library for MetaTrader 5

5. Runtime error

For unknown reasons, work with libraries compiled for MetaTrader 5 x64 ends with a "Stack Overflow" error. If it is connected with Skype4COM, then you have to wait for new messages to correct this error.

Attached is an archive of the library source code (a project for Microsoft Visual C++ 2010) and the test scripts used to check its performance.


Attachment download

📎 skypemql.mqh (2.26 KB)

📎 skype_test_script.mq5 (1.76 KB)

Source: MQL5 #1537

Verification code Refresh