纠错无须独占串口的VC的DEMO转BCB

求助纠错无须独占串口的VC的DEMO转BCB
早前在本论坛发帖问过如何不独占串口监控串口数据,大家都知道要用API,可没人真正玩出来。有个作者jfyes做出了CommMonitor串口监视精灵,该软件可以监控串口数据,无需独占串口,在工作中起了很大的作用。
4.0版的有二次开发SDK接口 DEMO,是DLL,更可惜只有delphi和VC的,因为对VC连入门级都算不上,踉踉跄跄地凑合成了bcb,可是搞得被监控的串口程序(尤其是BCB编制的程序)运行得不是很稳定了,常弹内存警告,请高人指点。
CommMonitor串口监视精灵DEMO界面:
http://www.ceiwei.com/upfile/2010123155902469.jpg

代码下载(内有详细接口说明):
http://www.skycn.com/soft/64411.html
http://www.crsky.com/soft/19798.html



有段源码是借用妖哥的minispy。

头文件:
#ifndef Unit1H
#define Unit1H
//---------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
#define IDC_START        1002
//---------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
        TComboBox *ComboBox1;
        TComboBox *ComboBox2;
        TLabel *Label3;
        TLabel *Label4;
        TCheckBox *CheckBox1;
        TStatusBar *StatusBar1;
        TButton *Button3;
        TButton *Button4;
        TImage *ImageDrag;
        TTimer *Timer1;
        TRichEdit *RichEdit1;
        void __fastcall ImageDragMouseDown(TObject *Sender,
          TMouseButton Button, TShiftState Shift, int X, int Y);
        void __fastcall ImageDragMouseMove(TObject *Sender,
          TShiftState Shift, int X, int Y);
        void __fastcall ImageDragMouseUp(TObject *Sender,
          TMouseButton Button, TShiftState Shift, int X, int Y);
        void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
        void __fastcall Button3Click(TObject *Sender);
        void __fastcall Timer1Timer(TObject *Sender);
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall Button4Click(TObject *Sender);
private: // User declarations
public: // User declarations
        __fastcall TForm1(TComponent* Owner);
        void OnStartMonitor(HWND hDlg);
        void FindItem(LPCSTR AStr, HWND hComBox);
};
//---------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------