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

📄 dllload.cpp

📁 1)动态加载中间(2)规范化中间层接口 (3)解释本地文件系统(4)基于数据库的数据提供(5)数据库设计(6)优化数据提供逻辑(7)程序框架结构图
💻 CPP
字号:
#include "stdafx.h"
#include "DllLoad.h"

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

//=============================================================================
// class TDllModule 
//DLLLOAD.CPP
//=============================================================================

TDllModule::TDllModule(LPCTSTR szName) 
{
  m_strName = szName;
  m_hHandle = NULL;
  m_nErrorCode = ERROR_NOTCREATED;
}
TDllModule::TDllModule() 
{
  m_strName ="";
  m_hHandle = NULL;
  m_nErrorCode = ERROR_NOTCREATED;
}


TDllModule::~TDllModule()
{
  Destroy();
}

// 动态加载中间层
// 成功返回TRUE

BOOL TDllModule::Create(void)
{
  m_hHandle = ::LoadLibrary(m_strName);
  if (m_hHandle == NULL) {
    m_nErrorCode = ERROR_DLLNOTFOUND;
    return FALSE;
  }
  m_nErrorCode = ERROR_OK;
  return TRUE;
}

BOOL TDllModule::Create(LPCTSTR szName)
{
  this->m_strName=szName;
  return this->Create();
}


// 卸载中间层
void TDllModule::Destroy(void)
{
  if (m_hHandle) {
    ::FreeLibrary(m_hHandle);
    m_hHandle = NULL;
    m_nErrorCode = ERROR_NOTCREATED;
  }
}

⌨️ 快捷键说明

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