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

📄 portdriver.h

📁 读dspf2812的内部程序
💻 H
字号:
//--------------------------------------------------------------------------------
#ifndef _PORTDRIVER_H
#define _PORTDRIVER_H
//---------------------------------------------------------------------------------
class PortDriver{
    HINSTANCE PortLib;
public:
    bool LibraryOk;
    PortDriver();
    int (_stdcall *InportBYTE)(int);
    int (_stdcall *OutportBYTE)(int,int);
    int (_stdcall  *InportWORD)(int );
    int (_stdcall  *OutportWORD)(int ,int );
    long (_stdcall  *InportDWORD)(int );
    long (_stdcall  *OutportDWORD)(int ,long );
    ~PortDriver();
    };
//---------------------------------------------------------------------------------
PortDriver::PortDriver()
{
    LibraryOk=true;
    PortLib=LoadLibrary("PortArt.dll");
    if(!PortLib)LibraryOk=false;
    if(PortLib){
	InportBYTE=(int (_stdcall *)(int))
            GetProcAddress(PortLib,"InportBYTE");
        if(!InportBYTE)LibraryOk=false;
        OutportBYTE=(int (_stdcall *)(int,int))
            GetProcAddress(PortLib,"OutportBYTE");
        if(!OutportBYTE)LibraryOk=false;
        InportWORD=(int (_stdcall *)(int))
            GetProcAddress(PortLib,"InportWORD");
        if(!InportWORD)LibraryOk=false;
        OutportWORD=(int (_stdcall *)(int,int))
            GetProcAddress(PortLib,"OutportWORD");
        if(!OutportWORD)LibraryOk=false;
        InportDWORD=(long (_stdcall *)(int))
            GetProcAddress(PortLib,"InportDWORD");
        if(!InportDWORD)LibraryOk=false;
        OutportDWORD=(long (_stdcall *)(int,long))
            GetProcAddress(PortLib,"OutportDWORD");
        if(!OutportDWORD)LibraryOk=false;
        }
    if(!LibraryOk){
          ShowMessage("Dyminate-Link-Library :PortArt.Dll Load Failure!");
          }
    }
//---------------------------------------------------------------------------------
PortDriver::~PortDriver()
{
    if(LibraryOk)FreeLibrary(PortLib);
    }
//---------------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------------

⌨️ 快捷键说明

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