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

📄 netmoduleinterface.cpp

📁 用事件方式
💻 CPP
字号:
// NetModuleInterface.cpp: implementation of the CNetModuleInterface class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "NetModuleInterface.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CString CNetModuleInterface::GetCurrentPath()
{
	char path[MAX_PATH];
	::GetModuleFileName(NULL,path,MAX_PATH);
	
	CString strPath(path);

	strPath=strPath.Left(strPath.ReverseFind('\\')+1);

	return strPath;
}
CNetModuleInterface::CNetModuleInterface()
{
	CString strPath=GetCurrentPath();
	strPath+=NetModuleInterfaceDLLName;

	hModule=LoadLibrary(strPath);

	StartServer			=(STARTSERVER)			GetProcAddress(hModule,"StartServer");
	StopServer			=(STOPSERVER)			GetProcAddress(hModule,"StopServer");
	SetNetInterfaceInfo	=(SETNETINTERFACEINFO)	GetProcAddress(hModule,"SetNetInterfaceInfo");
	ReadData			=(READDATA)				GetProcAddress(hModule,"ReadData");
	SendData			=(SENDDATA)				GetProcAddress(hModule,"SendData");
}

CNetModuleInterface::~CNetModuleInterface()
{
	FreeLibrary(hModule);
}

⌨️ 快捷键说明

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