p>
//--------------------------------------------------------------------------- PACKAGE TForm_prog * Form_prog;
//---------------------------------------------------------------------------
# endif
Файл Prog_view.cpp
//---------------------------------------------------------------------------
# include lt; vcl.h gt;
# pragma hdrstop
# include Prog_view.h
//---------------------------------------------------------------------------
# pragma package (smart_init)
# pragma resource *. dfm _prog * Form_prog;
//---------------------------------------------------------------------------
__ fastcall TForm_prog :: TForm_prog (TComponent * Owner)
: TForm (Owner)
{- gt; Cells [1] [0]= Address raquo ;; - gt; Cells [2] [0]= Instruction raquo ;; - gt; Cells [3] [0]= HexValue raquo ;; - gt; Cells [4] [0]= BinValue raquo ;;
}
//---------------------------------------------------------------------------__fastcall TForm_prog :: PaintProg (HINSTANCE DLL_Prog)
{ lt; ProgramCellMemory gt; Program; lt; ProgramCellMemory gt; (__ stdcall * GetProgram) (); (DLL_Prog) {
/* Виклик функції хзагрузкі програми мікроконтролера
з DLL * /=(vector lt; ProgramCellMemory gt; (__ stdcall *) ()) (DLL_Prog, _GetProgram );=GetProgram ();
}
//Очищення StringGrid1- gt; RowCount=2; - gt; Rows [1] - gt; Clear (); (unsigned int i=0; i lt; Program.size (); i ++ )
{Addr, Name, HexValue, BinValue, Operand;
//Запис тексту програми в ListBox1=IntToHex (Program (i) .GetAddr (), 4);=Program (i) .GetName ();=IntToHex (Program (i) .GetHexValue (), 4);=Form_view- gt; IntToBin (Program (i) .GetHexValue (), 14);=Program (i) .GetOperand (); - gt; Cells [1 ] [i + 1]=Addr; - gt; Cells [2] [i + 1]=Name + + Operand; - gt; Cells [3] [i + 1]= 0x + HexValue; - gt; Cells [4] [i + 1]=BinValue; - gt; RowCount=i + 2;
} PCounter; - gt; Cols [0] - gt; Clear (); (__ stdcall * GetPCounter) (); (DLL_Prog)
{
//Отримання значення програмного лічильника з DLL
GetPCounter=(int (__ stdcall *) ()) (DLL_Prog, _GetPCounter );
//Перевірка існування функції GetPCounter
if (GetPCounter) {
PCounter=GetPCounter ();
} ( Функція GetPCounter не знайдено );
} - gt; Row=PCounter + 1; - gt; Cells [0] [PCounter + 1]= * raquo ;;
} __ fastcall TForm_prog :: FormClose (TObject * Sender, TCloseAction amp; Action)
{- gt; SpeedButton2- gt; Down=false; - gt; ProgramViewCtrlP1- gt; Checked=false;
}
//---------------------------------------------------------------------------