Discuss this help topic in MsgConnect Forum

Filter: C++  Pascal  C#  VB.NET  Java  Java ME  ActiveX  DLL 



Messenger.CreateMessageFromText

Messenger     See also    


Sets properties (fields) of MCMessage structure including binary data (created from text string).

Declaration

[C++]
    static void CreateMessageFromText( long MsgCode, long Param1, long Param2, char* Text, bool IsVarData, MCMessage& Message);

[Pascal]
    class function CreateMessageFromText( MsgCode : integer; Param1 : integer; Param2 : integer; Text : string; IsVarData : boolean ) TMCMessage;

[VB6]
    Function IMCXMessenger4.CreateMessageFromText(MsgCode As Long, Param1 As Long, Param2 As Long, Text As String, IsVarData As Boolean) As IMCXMessage

[ActiveX]
    HRESULT _stdcall IMCXMessenger4.CreateMessageFromText( [in] long MsgCode, [in] long Param1, [in] long Param2, [in] BSTR Text, [in] VARIANT_BOOL IsVarData, [out, retval] IMCXMessage ** Message);

[C#]
    static MCMessage CreateMessageFromText( int MsgCode, int Param1, int Param2, string Text, Encoding Encoder, bool IsVarData );

[VB.NET]
    Public Shared Function CreateMessageFromText(ByVal MsgCode As Integer, ByVal Param1 As Integer, ByVal Param2 As Integer, ByVal [Text] As String, ByVal Encoder As Encoding, ByVal IsVarData As Boolean) As MCMessage

[Java]
    static MCMessage createMessageFromText( int msgCode, int param1, int param2, String text, CharsetEncoder encoder, boolean isVarData );

[Java ME]
    static MCMessage createMessageFromText( int msgCode, int param1, int param2, String text, CharsetEncoder encoder, boolean isVarData );

[DLL]
    void __stdcall MCMessengerCreateMessageFromText( long MsgCode, long Param1, long Param2, char* Text, bool IsVarData, MCMessage& Message);

Parameters

  • MsgCode - application-defined message code. Use this message code to identify the message on the recipient side.
  • Param1 - application-defined parameter of the message.
  • Param2 - application-defined parameter of the message.
  • Text - text which is converted to binary and placed to MCMessage.
  • [.NET, Java] Encoder - encoding object (can be null).
  • IsVarData - false if DataType is set to bdtConst and true if DataType is set to bdtVar.
  • Message - The record that CreateMessageFromText creates (when Message is a function result) and filled with specified parameters. See more here

Description

    Use this method to initialize main fields and convert text to binary data of MCMessage with one call. This method converts the text into system-default (by default) or specific (if Encoder is specified) character set and puts the resulting binary data to Data field of MCMessage.
    [C++, Pascal, DLL] After sending the message application needs to free the memory, referenced by Data field, using MCMemFree procedure.

See also:     MCMessage structure    

Discuss this help topic in MsgConnect Forum