Instant Communication Client Addin Framework 1

zhaozj2021-02-16  48

1. build a root com.export some interface;

2.Build a client exe to use the root COM;

3.BUILD a SUB COM to Implement the interface;

Just Test ...

Content

To Be Continue .....

Overview

Using COM development technology, implement instant messaging ADDIN plug-in, which can be freely embedded in other functions, without doing additional client and server source modification capabilities.

Mainly for the P2P (point-to-point) mode of the client, it can be applied to embed audio, video, voting, game and so on.

principle

Addin technology features:

On the basis of the completion of the main program development, free add new features, even unknown features.

The traditional plugin technology is inadequate:

1. The traditional model is in the form of a dynamic library for hard upgrade. If the function portfolio changes, the master program must be recompiled.

2. Traditional dynamic library mode, the function inlet is constant, and only one function is added, different functions coexistence and free addition deletion more difficult.

3. Traditional dynamic library mode development must comply with C mode, relative is not flexible, users are difficult to develop

Rough implementation principle:

1. Implement a ROOT COM DLL to open the function interface that needs to be reused.

2. Call the root COM in the main program using Addin, traverse all sub-interface lists, generally exist in a specific registry key, and call the corresponding functional interface.

3. After publishing the main program, addin developers inherit from root COM, develop new features COM DLL, and update the sub-interface list of root COM. And implement functional interfaces.

structure

Key to define the ROOT's reusable function interface;

1. Pack all the function modules A of all networks A, which acts that the method is not included in this document structure, built-in AddIN protocol. This module is generally provided:

(1). Ordinary function function: initialization, send data, close;

(2). Tune function, receive data, unusual disconnection;

2. All functions in A can be directly called in the root interface.

Currently divided into two root interfaces, one for file classes transmit IF, one for interacting command class file transfer ICs. Consider using a unified root interface implementation.

3. Tune by unified Eventsink

ROOT interface:

HRESULT INIT (BSTR SID, BSTR INFO, [OUT, RETVAL] long * PRET);

Function Description: Used to initialize the root interface object.

parameter:

The SID of this transaction is used for unique identity.

INFO custom information is customized by users. The XML method can be used.

The PRET function returns a prompt.

HRESULT Close ([OUT, RETVAL] long * PRET)

Function Description: Used to turn off the root interface object.

parameter:

The PRET function returns a prompt.

HRESULT Send (BSTR INFO, [OUT, RETVAL] long * PRET)

Function Description: Used to send information.

parameter:

INFO sends the content of the information. The PRET function returns a prompt.

HRESULT DO (BSTR INFO, [OUT, RETVAL] long * PRET)

Function Description: Simple processing used to receive the INFO message.

parameter:

INFO receives the content of the information.

The PRET function returns a prompt.

转载请注明原文地址:https://www.9cbs.com/read-20187.html

New Post(0)