注册 登录
编程论坛 PowerBuilder

怎样获取当前目录?

fxjjsara 发布于 2006-03-02 09:25, 1558 次点击
我用windows的API函数GetCurrentDirectory()获取当前的文件目录,
但是返回一行乱码。
请文是什么问题?如何解决?请多赐教!

[此贴子已经被作者于2006-3-2 9:26:25编辑过]

2 回复
#2
fxjjsara2006-03-02 15:49
多谢关注!
在师兄的帮助下,我找到答案了:
在声明函数时,调用ansi进行校正,
function ulong GetCurrentDirectory(参数略)"kernel32.dll" alias for "GetCurrentDirectoryA;anis"
千万不要把函数大小写搞错咯!
#3
潇洒老乌龟2006-03-13 22:41

如果是PB8或PB9直接用GetCurrentDirectory()
Description

Gets the current directory for your target application.

Syntax

GetCurrentDirectory ( )

Return value

String. Returns the full path name for the current directory.

This example puts the current directory name in a SingleLineEdit control:

sle_1.text = GetCurrentDirectory( )

1