corick 2022-09-27 10:06 采纳率: 75%
浏览 95
已结题

C++ Builder 怎么调用 inpout32.dll?

C++ Builder 怎么调用 inpout32.dll? 我用implib 生成了对应的lib文件,也用add proj 把lib文件导入工程中,其中的头文件inpout32.h是下载inpout32包里带有的,也#include 了,但是运行时却出现 [Linker Error] Unresolved external '__stdcall IsXP64Bit()' referenced from D:\BCBPROJ\DLLTEST\UNIT1.OBJ
这样的错误,哪位能指点一二,谢谢

程序主体C++ Builder 6
```c++
#include <vcl.h>
#pragma hdrstop

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


void __fastcall TForm1::Button1Click(TObject *Sender)
{
     IsXP64Bit();
}
//



```c++
头文件C++ Builder 6
//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:    // IDE-managed Components
        TButton *Button1;
        void __fastcall Button1Click(TObject *Sender);
private:    // User declarations
public:        // User declarations
        __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

软件自带的头文件inpout32.h,应该是vc++的


```c++
#pragma once

//Functions exported from DLL.
//For easy inclusion is user projects.
//Original InpOut32 function support
void    _stdcall Out32(short PortAddress, short data);
short    _stdcall Inp32(short PortAddress);

//My extra functions for making life easy
BOOL    _stdcall IsInpOutDriverOpen();  //Returns TRUE if the InpOut driver was opened successfully
BOOL    _stdcall IsXP64Bit();            //Returns TRUE if the OS is 64bit (x64) Windows.

//DLLPortIO function support
UCHAR   _stdcall DlPortReadPortUchar (USHORT port);
void    _stdcall DlPortWritePortUchar(USHORT port, UCHAR Value);

USHORT  _stdcall DlPortReadPortUshort (USHORT port);
void    _stdcall DlPortWritePortUshort(USHORT port, USHORT Value);

ULONG    _stdcall DlPortReadPortUlong(ULONG port);
void    _stdcall DlPortWritePortUlong(ULONG port, ULONG Value);

//WinIO function support (Untested and probably does NOT work - esp. on x64!)
PBYTE    _stdcall MapPhysToLin(PBYTE pbPhysAddr, DWORD dwPhysSize, HANDLE *pPhysicalMemoryHandle);
BOOL    _stdcall UnmapPhysicalMemory(HANDLE PhysicalMemoryHandle, PBYTE pbLinAddr);
BOOL    _stdcall GetPhysLong(PBYTE pbPhysAddr, PDWORD pdwPhysVal);
BOOL    _stdcall SetPhysLong(PBYTE pbPhysAddr, DWORD dwPhysVal);








  • 写回答

4条回答

      报告相同问题?

      相关推荐 更多相似问题

      问题事件

      • 系统已结题 10月5日
      • 赞助了问题酬金20元 9月27日
      • 创建了问题 9月27日

      悬赏问题

      • ¥15 linux磁盘怎样重新挂载到原挂载路径下
      • ¥15 Java的类和静态方法
      • ¥15 存在一定规律的数据转置和整理
      • ¥15 关于flowable工作流开发的一个问题
      • ¥20 VBA如何用代码在onedrive创建文件夹?
      • ¥15 多理发师睡眠问题,2个理发师,n个座椅
      • ¥15 FPGA两按键控制led灯程序
      • ¥40 大学的python问题,用python解决
      • ¥30 用Java实现网上商场购物车功能
      • ¥15 程序设计:食堂菜品管理系统