Adsense

Donate

主页 arrow 更新一览 arrow 安装路径是中文的时候出错问题的解决
安装路径是中文的时候出错问题的解决

 有人报告说Minidx安装好程序执行就出错,确认了一下发现是安装在了中文目录下,主要是文字编码问题,原来在读取目录的时候直接调用了GetModuleFileNameA函数,然后利用_splitpath解析,改成GetModuleFileName和_tsplitpath,在UNICODE下编译就OK了。下面是一些_splitpath, _wsplitpath 的资料。

_splitpath, _wsplitpath 

 

Break a path name into components. These functions are deprecated because more secure versions are available, see _splitpath_s, _wsplitpath_s.

void _splitpath(
const char *path,
char *drive,
char *dir,
char *fname,
char *ext
);
void _wsplitpath(
const wchar_t *path,
wchar_t *drive,
wchar_t *dir,
wchar_t *fname,
wchar_t *ext
);

Parameters

path

Full path

drive

Optional drive letter, followed by a colon (:)

dir

Optional directory path, including trailing slash. Forward slashes ( / ), backslashes ( \ ), or both may be used.

fname

Base filename (no extension)

ext

Optional filename extension, including leading period (.)

var ExpCollDivStr = ExpCollDivStr; ExpCollDivStr = ExpCollDivStr + "ctl00_LibFrame_ctl1097bc07c,"; var ExpCollImgStr = ExpCollImgStr; ExpCollImgStr = ExpCollImgStr + "ctl00_LibFrame_ctl10img,";
 
RemarksRemarks

The _splitpath function breaks a path into its four components. _splitpath automatically handles multibyte-character string arguments as appropriate, recognizing multibyte-character sequences according to the multibyte code page currently in use. _wsplitpath is a wide-character version of _splitpath; the arguments to _wsplitpath are wide-character strings. These functions behave identically otherwise

Security Note    These functions incur a potential threat brought about by a buffer overrun problem. Buffer overrun problems are a frequent method of system attack, resulting in an unwarranted elevation of privilege. For more information, see Avoiding Buffer Overruns. More secure versions of these functions are availalble; see _splitpath_s, _wsplitpath_s.

Generic-Text Routine Mappings
TCHAR.H routine _UNICODE & _MBCS not defined _MBCS defined _UNICODE defined

_tsplitpath

_splitpath

_splitpath

_wsplitpath

Each argument is stored in a buffer; the manifest constants _MAX_DRIVE, _MAX_DIR, _MAX_FNAME, and _MAX_EXT (defined in STDLIB.H) specify the maximum size necessary for each buffer. The other arguments point to buffers used to store the path elements. After a call to _splitpath is executed, these arguments contain empty strings for components not found in path. You can pass a NULL pointer to _splitpath for any component you don't need.

If path is NULL, the invalid parameter handler is invoked, as described in Parameter Validation. If execution is allowed to continue, errno is set to EINVAL and the function returns EINVAL.

var ExpCollDivStr = ExpCollDivStr; ExpCollDivStr = ExpCollDivStr + "ctl00_LibFrame_ctl14a22d61b,"; var ExpCollImgStr = ExpCollImgStr; ExpCollImgStr = ExpCollImgStr + "ctl00_LibFrame_ctl14img,";

RequirementsRequirements

Routine Required header Compatibility

_splitpath

<stdlib.h>

Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003

_wsplitpath

<stdlib.h> or <wchar.h>

Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003

 

 
< Prev   Next >
© 2017 Minidx文件管理系统 | Minidx全文搜索引擎
Minidx! is a professional file management system.