解析路径

作者在 2009-07-22 11:46:05 发布以下内容
DWORD GetServiceInfFilePath_Passthru(
          LPTSTR lpFilename,
          DWORD nSize
          )
{
 // Get Path to This Module
 DWORD nResult;
 TCHAR szDrive[ MAX_PATH ];
 TCHAR szDir[ MAX_PATH ];
 
 nResult = GetModuleFileName( NULL, lpFilename, nSize );
 
 if( nResult == 0 )
 {
  return 0;
 }
 
 _splitpath( lpFilename, szDrive, szDir, NULL, NULL );
 
 _makepath( lpFilename, szDrive, szDir, "netsf", ".inf" );
 
 return (DWORD )strlen( lpFilename );
}

int main(int argc, char* argv[])
{
 printf("Hello World!\n");
 char lpFilename[MAX_PATH] = {0};
 DWORD nSize =  sizeof(lpFilename);
 GetServiceInfFilePath_Passthru(lpFilename,nSize);
 return 0;
}
默认分类 | 阅读 2168 次
文章评论,共0条
游客请输入验证码
浏览318287次