|
아래와 같이 OCX를 이용하여 스캐닝하는 함수를 구현하였습니다.
호출은 버튼 이벤트에서 하고요... 헤더에 함수선언 해주었고요.
그런데 이함수를 unit 을 하나 추가하여 함수를 분리하려고 합니다.
unit의 헤더와 구현을 어떻게 구성해야 할까요?
#include <vcl.h>
#pragma hdrstop
#include "U_FuncTest.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "TWIZLib_OCX"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// 함수
void __fastcall TForm1::wf_scanner(WideString scan_file)
{
Twiz1->Units=TWIZ_INCHES;
Twiz1->PixelType=1;
Twiz1->AcquireToFile(scan_file);
}
// 호출
void __fastcall TForm1::Button1Click(TObject *Sender)
{
WideString file1;
file1="c:\\test.bmp";
wf_scanner(file1);
}
/////// 헤더 ////////////////////////////////////
...
class TForm1 : public TForm
{
__published:
TTwiz *Twiz1;
TButton *Button1;
void __fastcall Button1Click(TObject *Sender);
private:
public:
__fastcall TForm1(TComponent* Owner);
void __fastcall wf_scanner(WideString scan_file);
};
...
|