⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.cpp

📁 短信开发控件
💻 CPP
字号:
// test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <stdio.h> 
#include <windows.h> 

int main(int argc, char* argv[])
{
	//调入DLL
	HINSTANCE hLib = LoadLibrary("kkstar_sms.dll");
	char* Result=NULL;
	//定义 GetGatewayList()
	typedef char* (__stdcall *DLLFunction_1)();
	//取得 GetGatewayList() 入口地址
	DLLFunction_1 GetGatewayList = (DLLFunction_1)GetProcAddress(hLib,"GetGatewayList");
	//调用 GetGayewayList()
	Result = GetGatewayList();
	//显示网关列表
	printf("网关列表:\n");
	printf("------------------------------------------------\n");
	printf("%s",Result);
	printf("------------------------------------------------\n");

	//定义 SendSms()
	typedef char* (__stdcall *DLLFunction_2)(
		char* lpGateway,
		char* lpUserName,
		char* lpPassword,
		char* lpPhone,
		char* lpContent,
		char* lpNickName,
		char* lpExtent );
	//取得 SendSms() 入口地址
	DLLFunction_2 SendSms = (DLLFunction_2)GetProcAddress(hLib,"SendSms");
	//调用 SendSms()
	Result = SendSms(
		"sina.com",  //或者其他网关代号
		"我的登录账号",
		"我的登录密码",
		"13987xxxxxx",
		"你好吗?记得过来玩呀!",
		"我的昵称",
		"" );
	//显示发送结果
	printf("发送结果:%s\n",Result);
	printf("------------------------------------------------\n");
	//释放DLL
	Result=NULL;
	FreeLibrary(hLib);

	printf("Press Ctrl+C to return ...\n");
	char* str;
	scanf("%s",str);
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -