const char* getModuleFileName()
{
static char Result[256]="";
if( !Result[0] )
{
char Tmp[256], *End=Tmp;
GetModuleFileName( NULL, Tmp, ARR_COUNT(Tmp) );//returns the path for the file used to create the calling process.
while( strchr(End,'//') )
End = strchr(End,'//')+1;
while( strchr(End,'/') )
End = strchr(End,'/')+1;
if( strchr(End,'.') )
*strchr(End,'.') = 0;
CStr::strcpy( Result, End );
}
return Result;
}
strchr 使用例子
最新推荐文章于 2023-07-21 09:39:44 发布