Use paho-mqtt3c.dll in MT4 - How to write the import block?

 
Hello,

I would like to transfer some information to an MQTT server. Since this is not part of the standard functionality, I would like to use a library which is available as a DLL (links below). Unfortunately I don't have much experience with MQL4 or C and fail with the import block definition.


I understand that the definition with simple data types is relatively simple. A nice example from Win32User.mqh:


#import "user32.dll"
   int SendMessageA(int hWnd,int Msg,int wParam,int lParam);
#import
As an example in my case I would like to use the following function: https://eclipse.github.io/paho.mqtt.c/MQTTClient/html/_m_q_t_t_client_8h.html#a9a0518d9ca924d12c1329dbe3de5f2b6

int MQTTClient_create ( MQTTClient * handle,
  const char * serverURI,
  const char * clientId,
  int persistence_type,
  void * persistence_context 
)
Can someone give me a hint how such a definition could look like in the definition block? I guess it should go in this direction:

#import "paho-mqtt3c.dll"
  int MQTTClient_create(???, const char *, const char *, int, ???)
#import

Links to the MQTT library:

  • Library: https://github.com/eclipse/paho.mqtt.c
  • Direct download of the DLLs: https://github.com/eclipse/paho.mqtt.c/releases/download/v1.3.12/eclipse-paho-mqtt-c-win32-1.3.12.zip
  • API Docs: https://eclipse.github.io/paho.mqtt.c/MQTTClient/html/index.html

GitHub - eclipse/paho.mqtt.c: An Eclipse Paho C client library for MQTT for Windows, Linux and MacOS. API documentation: https://eclipse.github.io/paho.mqtt.c/
GitHub - eclipse/paho.mqtt.c: An Eclipse Paho C client library for MQTT for Windows, Linux and MacOS. API documentation: https://eclipse.github.io/paho.mqtt.c/
  • eclipse
  • github.com
This repository contains the source code for the Eclipse Paho MQTT C client library. This code builds libraries which enable applications to connect to an MQTT broker to publish messages, and to subscribe to topics and receive published messages. Synchronous and various asynchronous programming models are supported. Information About MQTT...
 

Something like this ?

#import "paho-mqtt3c.dll"
  int MQTTClient_create(int , const char &[], const char &[], int, int)
#import

MT4 topic should be posted in MT4 section of the forum.