发表于:2003-09-01 10:57:00
楼主
求助凌华技术人员:
我购买了PCI9111数据采集卡,开发环境win2000,C++builder 5.0.
用bcpcidsak.lib(卡附带光盘中\LIB\bcpcidsak.lib)开发一段时间后,我发现我的应用程序老是关不掉(窗口关掉后,在任务管理器中显示应用程序还在运行);
于是我开始怀疑自带的bcpcidsak.lib,我就用C++ builder 自带的IMPLIB,把PCI-Dask.dll转化成lib文件,添加进项目中,结果还是一样.希望有经验的前辈帮我解决这个问题.
做了一个最简单的测试:一个Form,两个Button.编译通过,但结束不了进程????
Unit1.h
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "Dask.h"
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton *Button1;
TButton *Button2;
TLabel *Label1;
void __fastcall Button1Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
void __fastcall FormDestroy(TObject *Sender);
private: // User declarations
U16 CardID;
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Unit1.cpp
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{ CardID=-1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
CardID = Register_Card(PCI_9111DG, 0);
if (CardID >= 0)
Label1->Caption="ok";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormDestroy(TObject *Sender)
{
if (CardID >= 0)
Release_Card (CardID);
}
//---------------------------------------------------------------------------