• UIKit
  • SDK
  • 서버 API
Chat/
SDK/
Windows/
SDK
  • Chat SDK 설치
  • Chat SDK 초기화
  • 로그인 및 로그아웃
  • 메시지
    • 개요
    • 메시지 보내기
    • 메시지 받기
    • 메시지 검색
    • 메시지 전달
    • 메시지 수정
    • 삽입 메시지
    • 메시지 삭제
    • 과거 메시지 비우기
    • 메시지 철회
    • 온라인 메시지 보내기
    • 메시지 읽음 확인
    • 메시지 조회
    • 알림
    • Targeted Group Messages
    • 알림 차단
    • Key-Value 확장
    • 반응
    • 번역
    • 메시지 최상단 고정
  • 대화
    • 개요
    • 대화 목록
    • 대화 획득
    • 읽지 않은 메시지 수
    • 대화 최상단 고정
    • 대화 삭제
    • 초안
    • 마크
    • 대화 그룹
  • 그룹
    • 개요
    • 그룹 관리
    • 정보
    • 멤버 관리
    • 멤버 정보
    • 속성
    • 카운터
  • 커뮤니티 및 화제
    • 커뮤니티 관리
    • 권한 그룹
  • 사용자
    • 사용자 정보
    • 사용자 상태
    • 친구 관리
    • 친구 그룹화
    • 블록리스트
    • Follow
  • 국부 검색
    • 메시지 검색
    • 친구 검색
    • 그룹 검색
    • 그룹 멤버 검색
  • 시그널링
  • 인터페이스 참고 문서
    • C++
    • C
  • Changelog
  • Guideline for Beginners
  • 콘솔 안내
    • 애플리케이션 생성 및 업그레이드
    • 기본 구성
    • 기능 구성
    • 계정 관리
    • 그룹 관리
    • 콜백 구성
  • 제품 소개
    • 메시지 관리
      • 1대1 메시지
      • 메시지 저장
      • 오프라인 푸시
      • 그룹 메시지
      • 메시지 포맷
    • 계정 시스템
      • 로그인 인증
      • 온라인 상태 관리
    • 그룹 관련
      • 그룹 시스템
      • 그룹 관리
    • 사용자 정보 및 관계망
      • 정보 관리
      • 관계망 관리
  • 구매 가이드
    • 과금 개요
    • 가격
  • 에러코드
이 페이지는 현재 영어로만 제공되며 한국어 버전은 곧 제공될 예정입니다. 기다려 주셔서 감사드립니다.

Chat SDK 설치

This document describes how to quickly integrate the Tencent Cloud IM SDK into your Windows project.

Environment Requirements

Operating system: Windows 7 or later.
Development environment: Visual Studio 2010 or later. Visual Studio 2019 is recommended.

Integrating the IM SDK

The following describes how to integrate the SDK into a Visual Studio 2019 project by creating a simple MFC project.

Step 1. Download the IM SDK

Download the IM SDK for Windows here as follows:


Download and decompress the IM SDK. You can rename it "ImSDK". It contains the following parts:
Directory Name
Description
include
API header file
lib\Win32
32-bit Release mode, which uses the /MT option to link library files.
lib\Win64
64-bit Release mode, which uses the /MT option to link library files.

Step 2. Create a project

Open Visual Studio and create an MFC application named "IMDemo". If the MFC application is not one of the first options, you can search for it through the search template at the top.



For quick integration, select the relatively simple Dialog based type on the Application Type page of the wizard. For other configuration items, keep them as default.




Step 3. Copy the files

Copy the IM SDK folder generated after decompression (the "ImSDK" folder obtained in step 1) to the directory where IMDemo.vcxproj is located.




Step 4. Modify the project configuration

The IM SDK provides 32-bit and 64-bit static libraries in Release mode, which require some special configurations. Open the IMDemo attribute page, select Solution Explorer, right-click IMDemo, and select Properties.
The following takes the 32-bit Release mode as an example:
1. Add the include directory. Go to C/C++ > General > Additional Include Directories and add the IM SDK header file directory $(ProjectDir)ImSDK\include.



2. Add the library directory. Go to Linker > General > Additional Library Directories and add the IM SDK library directory $(ProjectDir)ImSDK\lib\Win32.



3. Add the library file. Go to Linker > Input > Additional Dependencies and add the IM SDK library file ImSDK.lib.



4. Copy the DLL file to the execution directory. Go to Build Events > Pre-Build Event > Command Line, enter xcopy /E /Y "$(ProjectDir)ImSDK\lib\Win32" "$(OutDir)", and copy the ImSDK.dll dynamic library file to the output directory of the project.



5. Specify the encoding format of the source file. The IM SDK header file uses the UTF-8 encoding format, whereas some compilers compile source files in the default system encoding format. This may lead to compilation failure. Set this parameter to instruct compilers to compile source files using UTF-8 encoding. Go to C/C++ > Command Line > Additional Options and enter /source-charset:.65001.



Most of the settings for the 64-bit Release are similar to those for the 32-bit Release. The difference lies in the IM SDK library directory as follows:
1. Add the library directory.
Go to Linker > General > Additional Library Directories and add the IM SDK library directory $(ProjectDir)ImSDK\lib\Win64.



2. Copy the DLL file to the execution directory.
In Release mode, go to Build Events > Pre-Build Event > Command Line, enter xcopy /E /Y "$(ProjectDir)ImSDK\lib\Win64" "$(OutDir)", and copy the ImSDK.dll dynamic library file to the output directory of the project.




Step 5. Print the IM SDK version number

In the IMDemoDlg.cpp file, add the header file inclusion:
#include "TIMCloud.h"
#include <string>
In the IMDemoDlg.cpp file, find the CIMDemoDlg::OnInitDialog function and add the following test code before return:
SetWindowText(L"IMDemo");
std::string version = TIMGetSDKVersion();
CString szText;
szText.Format(L"SDK version: %hs", version.c_str());
CWnd* pStatic = GetDlgItem(IDC_STATIC);
pStatic->SetWindowTextW(szText);
Press F5 to run the code and print the IM SDK version number.




FAQs

If the following error occurs, check whether the directory of the IM SDK header file has been correctly added according to the preceding project configuration:
fatal error C1083: unable to open the header file: "TIMCloud.h": No such file or directory
If the following error occurs, check whether the IM SDK library directory and library file have been correctly added according to the preceding project configuration:
LINK : fatal error LNK1104: Unable to open the `ImSDK.lib` file.
error LNK2019: Unresolved external symbol `__imp__TIMGetSDKVersion`, referenced in the `"protected: virtual int __thiscall CIMDemoDlg::OnInitDialog(void)" (?OnInitDialog@CIMDemoDlg@@MAEHXZ)` function
If an error occurs, check whether the IM SDK's DLL has been copied to the execution directory as described in the project configuration step above.