y‰SŽÒнŒ}zC/C++Ž ..
[
2ch
|
¥Menu
]
¡ƒRƒsƒyƒ‚[ƒh
ƒXƒŒ‚ð’Êí•\ަ
ƒIƒvƒVƒ‡ƒ“ƒ‚[ƒh
‚±‚̽گÄÞ‚ÌURL
¡€–ÚƒeƒLƒXƒg
403:ƒfƒtƒHƒ‹ƒg‚Ì–¼–³‚µ‚³‚ñ 08/02/11 11:08:24 ‚È‚ñ‚Å CoCreateInstance Žg‚Á‚ĂȂ¢‚ÌH 404:ƒfƒtƒHƒ‹ƒg‚Ì–¼–³‚µ‚³‚ñ 08/02/11 11:21:28 CoCreateInstance‚̓ŒƒWƒXƒgƒŠ‚É“o˜^‚µ‚È‚¢‚ÆŽg‚¦‚È‚¢‚ÆA‚Ç‚±‚©‚ÅŒ©‚½‹L‰¯‚ª‚ ‚è X‚ÉDirectX‚̃ŒƒWƒXƒgƒŠ“o˜^‚ðŒ©‚éŒÀ‚èAmusic‚µ‚©‚È‚©‚Á‚½‚̂Š‚±‚Ì•û–@‚Å‚¢‚¯‚é‚ñ‚¶‚á‚È‚¢‚©‚ÆŽv‚Á‚Ä‚¢‚Ü‚µ‚½ CoCreateInstance‚Ì•û‚Å’²‚×‚ÄŽŽ‚µ‚Ă݂܂· Žw“E‚ ‚肪‚Æ‚¤‚²‚´‚¢‚Ü‚µ‚½ 405:388 ‚Å‚«‚Ü‚µ‚½ 08/02/11 11:27:38 #include <iostream> #include <vector> #include <string> #include <windows.h> using namespace std; class dirserch{ vector <string> dirname; vector <int > dir[300];@string path[300]; int n; WIN32_FIND_DATA fd; HANDLE hd; public: dirserch(char *ch); int next(string &str); }; main(){ dirserch dr("c:\\windows"); string str; while(dr.next(str))cout<<str<<endl;} dirserch::dirserch(char *ch){ n=0; path[0]=""; dir[0].push_back(0); dirname.push_back(ch); hd=NULL;} int dirserch::next(string &str){ for(;;){ if(hd==NULL){ int k=dir[n].size()-1; if(k<0){ if(n==0)return NULL; n--; continue; } path[n+1] = path[n] + dirname[dir[n][k]] + "\\"; dir[n].resize(k); n++; hd = FindFirstFile((path[n]+"*").c_str(), &fd);} for(;;){ if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY){ if(fd.cFileName[0]!='.' || ( fd.cFileName[1]!='.' && fd.cFileName[1]!='\0' )){ int k=dirname.size(); dir[n].push_back(k); dirname.push_back(fd.cFileName);}} else { str=path[n]+fd.cFileName; if(!FindNextFile(hd, &fd)){CloseHandle(hd); hd=NULL;} return 1;} if(!FindNextFile(hd, &fd)){CloseHandle(hd); hd=NULL;break;}}}}
ŽŸƒy[ƒW
ÅVƒŒƒX•\ަ
ƒXƒŒƒbƒh‚ÌŒŸõ
—ÞŽ—ƒXƒŒˆê——
˜b‘è‚̃jƒ…[ƒX
‚¨‚Ü‚©‚¹ƒŠƒXƒg
¥ƒIƒvƒVƒ‡ƒ“‚ð•\ަ
ƒŒƒXƒWƒƒƒ“ƒv
mixiƒ`ƒFƒbƒNI
Twitter‚É“Še
ƒIƒvƒVƒ‡ƒ“
‚µ‚¨‚è‚ð‹²‚Þ
ƒXƒŒƒbƒh‚É‘ž
ƒXƒŒƒbƒh‚̈ꗗ
‰É‚‚Ԃµ2ch
4987“ú‘O‚ÉXV/249 KB
’S“–:undef