|
그럼 어떻게 해야 할까요?
Lyn 님이 쓰신 글 :
: void 함수는 값을 리턴 할 수 없습니다.
:
: 강아지 님이 쓰신 글 :
: : [C++ Error] SDIMAIN.CPP(69): E2467 '_fastcall TSDIAppForm::Button1Click(TObject *)' cannot return a value
: : [C++ Warning] SDIMAIN.CPP(94): W8004 'bCreated' is assigned a value that is never used
: :
: : 에러는 상기아 같이 납니다.
: :
: : 원문은
: : //---------------------------------------------------------------------
: : #include <vcl.h>
: : #include <odbcinst.h>
: : #pragma hdrstop
: : // #include <stdafx.h>
: : #pragma link "odbccp32.lib"
: :
: : #include "SDIMain.h"
: : #include "About.h"
: : #include "easybook.h"
: :
: :
: :
: : //---------------------------------------------------------------------
: : #pragma resource "*.dfm"
: :
: : TSDIAppForm *SDIAppForm;
: :
: :
: : void __fastcall TSDIAppForm::Button1Click(TObject *Sender)
: : {
: : ganpyunjangbu->Show();
: :
: :
: : AnsiString m_strPath = ExtractFilePath(ParamStr(0));
: :
: : AnsiString strMainDBPath;
: : strMainDBPath = m_strPath +"\MainDB.mdb";
: :
: : if (FileExists(strMainDBPath))
: : {
: : ShowMessage ("MainDB is Exists already!") ;
: : return -1;
: : }
: :
: : strMainDBPath = "CREATE_DB=\"" + strMainDBPath + "\" General\0";
: :
: :
: : ShowMessage (strMainDBPath.c_str()) ;
: :
: :
: : bool bCreated;
: : bCreated = SQLConfigDataSource(
: : NULL,
: : ODBC_ADD_DSN,
: : "Microsoft Access Driver (*.mdb)",
: : strMainDBPath.c_str() //"CREATE_DB=c:\\Test.mdb General\0"
: : );
: :
: :
: : if (bCreated == true)
: : {
: : return 0;
: : }
: : else return -2;
: :
: :
: : }
: : //---------------------------------------------------------------------------
: :
: :
: :
: : 김진호.불사새 님이 쓰신 글 :
: : : 뭐라고 에러가 나는지요? 그걸 올려주시거나 에러를 자세히 보시면 다 답이 있습니다.
: : :
: : : 혹시 return하고자 하는 함수를 void로 선언 하신건 아닌지요.
: : :
: : : 강아지 님이 쓰신 글 :
: : : : if (bCreated == true)
: : : : {
: : : : return 0;
: : : : }
: : : : else return -2;
: : : :
: : : :
: : : : 프로그래밍 중
: : : : 상기와 같이 return 문구가 이쓰면
: : : : 계속 오류가 납니다.
: : : : 이거 왜 이러져?
: : : :
: : : : 특별히 문제 없어 보이는데요?
|