unit1.cpp

来自「南京沁恒电子有限公司USB通用设备接口芯片资料」· C++ 代码 · 共 37 行

CPP
37
字号
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

      #include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
        if ( LoadLibrary( "CH365DLL.DLL" ) == NULL )  // 加载DLL失败,可能未安装到系统中
          {
                  Application->MessageBox("无法加载CH365的DLL", "information", MB_ICONSTOP | MB_OK );

          }

         else if ( CH365mOpenDevice( 0,TRUE,TRUE ) < 0 ) // 使用之前必须打开设备
                   Application->MessageBox("打开CH365设备", "information", MB_OK );

          else
          {
                  Application->MessageBox( "无法打开CH365设备", "information", MB_OK );

          }
}
//---------------------------------------------------------------------------
 

⌨️ 快捷键说明

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