Код программы. Вывод основных уведомлений, страница 6

Ftest->DB1->DatabaseName = Ftest->id.db_path;

Ftest->DB1->Params->Strings[0] = "user_name="+Ftest->id.db_user;

Ftest->DB1->Params->Strings[1] = "password="+Ftest->id.db_pass;

try

{

Ftest->DB1->Connected = true;

Ftest->Transaction1->Active = true;

}

catch(...)

{

Application->MessageBoxA("Невозможно установить соединение с БД!", "Проблема соединения", MB_OK + MB_ICONSTOP);

return;

}

Type_Group->ItemEnabled[0] = false;

Type_Group->ItemEnabled[2] = false;

Type_Group->ItemEnabled[3] = false;

Type_Group->ItemIndex = 1;

}

//--------------------------------------------------------------------------void __fastcall TFttest::FormClose(TObject *Sender, TCloseAction &Action)

{

if (!Ftest->end) {

Ftest->Transaction1->CommitRetaining();

Ftest->DB1->Connected = false;

Ftest->Transaction1->Active = false;

}

}

//------------------------------------------------------------------------


Папка “Main\Tester” Unit1

//--------------------------------------------------------------------------#include <vcl.h>

#include <windows.h>

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

#include "Unit2.h"

#include "Ttest.h"

#include "Tem.h"

#include "Res.h"

#pragma hdrstop

//--------------------------------------------------------------------------#pragma argsused

extern "C" __export void Loader(int user_uin, int shabl);

int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)

{

return 1;

}

//--------------------------------------------------------------------------void Loader(int user_uin, int shabl)

{

Application->CreateForm(__classid(TFtest), &Ftest);

Application->CreateForm(__classid(TFresult), &Fresult);

Application->CreateForm(__classid(TFttest), &Fttest);

Application->CreateForm(__classid(TFtem), &Ftem);

Application->Icon->LoadFromFile(GetCurrentDir()+"\\SUN.ico");

Fttest->Position = poScreenCenter;

Ftem->Position = poScreenCenter;

Ftest->uin = user_uin;

Ftest->nshabl = shabl;

//      Ftest->ShowModal();

Ftest->Position = poScreenCenter;

Fresult->Position = poScreenCenter;

Fttest->ShowModal();

}


Папка “Main\Tester” Unit2

//--------------------------------------------------------------------------#include <vcl.h>

#pragma hdrstop

#include "Unit2.h"

#include "Res.h"

//--------------------------------------------------------------------------#pragma package(smart_init)

#pragma link "RzButton"

#pragma link "RzRadChk"

#pragma link "IBCustomDataSet"

#pragma link "IBDatabase"

#pragma link "IBQuery"

#pragma link "IBSQL"

#pragma link "RzPanel"

#pragma resource "*.dfm"

TFtest *Ftest;

//--------------------------------------------------------------------------__fastcall TFtest::TFtest(TComponent* Owner)

: TForm(Owner)

{

}

//--------------------------------------------------------------------------void TFtest::convert_answ(AnsiString ans)

{

// Конвертируем правильные ответы

int len = StrLen(ans.c_str());

for (int i = 0; i <= count - 1; i++) {

check[i]->Tag = 0;

}

for (int i = 0; i < len; i++) {

check[StrToInt(ans[i + 1]) - 1]->Tag = 1;

}

}

//--------------------------------------------------------------------------void TFtest::STOP_ALL()

{

// Если тестирование завершено

Timer1->Enabled = false;

Label1->Caption = "Тестирование завершено";

if (Application->MessageBoxA("Тестирование завершено. Нажмите OK для просмотра результатов", "Тестирование", MB_OK + MB_ICONINFORMATION) == IDOK) {