|
int __stdcall에 관한 질문입니다..
아래는 책에 나와있는 예제 입니다..(윈도우 탐색기 처럼 서브디렉토리 파일명과 폴더를 표시해 주는 프로그램 입니다)
예제는 볼랜드 C++ builder 정복 4.0(정태영)
프로젝트 파일(Explorer.BPR) 파일의 일부 입니다.----> p568
여기서 궁금한것은..왜..int__stdcall 을 써야 하는지.. 다른 함수는 왜 쓸수 없는지
int __stdcall CustomSortProc(LPARAM Item1, LPARAM Item2, LPARAM ParamSort)
{
int iResult;
AnsiString FItem, SItem;
switch(LOWORD(ParamSort)) {
case 0 : iResult = lstrcmp(((TListItem *)Item1)->Caption.c_str(),
((TListItem *)Item2)->Caption.c_str());
break;
case 1 : FItem = ((TListItem *)Item1)->SubItems->Strings[0];
SItem = ((TListItem *)Item2)->SubItems->Strings[0];
FItem = FItem.SubString(0, FItem.LastDelimiter(" ") - 1);
SItem = SItem.SubString(0, SItem.LastDelimiter(" ") - 1);
for (int i = 1; i < FItem.Length(); i++)
if (FItem[i] == ',') FItem.Delete(i, 1);
for (int i = 1; i < SItem.Length(); i++)
if (SItem[i] == ',') SItem.Delete(i, 1);
if (FItem.ToInt() > SItem.ToInt()) iResult = 1;
else iResult = -1;
break;
case 2 : iResult = lstrcmp(((TListItem *)Item1)->SubItems->Strings[1].c_str(),
((TListItem *)Item2)->SubItems->Strings[1].c_str());
}
if (HIWORD(ParamSort)) return -iResult;
return iResult;
}
이것은 책에 나와있는 예제 입니다..
|