|
안녕하세요.
꼼지락.수야입니다. 왕허접이죠.. ㅡㅡ;
님이 하신걸 해본결과.. 버튼으로도 시간 세팅이 되는군여~
님이 먼가 하나 빼먹으신거 같다는 느낌이 뇌를 스쳤습니다.
혹시.. dos.h 화일을 include 시켜주셨나요?
그리고.. struct time t;
이부분은 쓸데 없을것 같습니다. 암만봐두.. 전혀 필요없는...
그리고 char ctime[9] <- 요걸 이용한 시간설정은 안해봤습니다.
참고하시길.
혹시 모르니 제가 잠시 테스트한걸 복사해 드리져~
unit1.cpp 부분입니다.
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
struct time t;
gettime(&t);
t.ti_hour++;
settime(&t);
}
//---------------------------------------------------------------------------
unit1.h 화일입니다
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <dos.h>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton *Button1;
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
char ctime[9] ; // 12:12:12
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
도움이 됐으면 합니다.
컴퓨터 앞에서 꼼지락 거리는 수야였습니다.
|