FtpGetCurrentDirectory()怎么不好使?

cub 2002-10-09 11:52:28
char bb[MAX_PATH]="";
unsigned long bblong=MAX_PATH;
int num=0;
num=FtpGetCurrentDirectory(*phFtpConn,bb,&bblong);
CString cc;
cc.Format("当前路径:%s 取回字符数=%d",bb,num);
AfxMessageBox(cc);
登陆后执行上述代码结果当前路径为空,取回字符数为0
是怎么回事?
...全文
322 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
cub 2002-10-09
  • 打赏
  • 举报
回复
哦,不好意思,把返回值看错了
但是为什么当前路径是空的呢?
guopo 2002-10-09
  • 打赏
  • 举报
回复
BOOL FtpGetCurrentDirectory(...);
cub 2002-10-09
  • 打赏
  • 举报
回复
MSDN我有,不用给我拷这东西,正面给解答错误原因,如何改正,谢谢
qing_li73 2002-10-09
  • 打赏
  • 举报
回复

BOOL FtpGetCurrentDirectory(
IN HINTERNET hFtpSession,
OUT LPSTR lpszCurrentDirectory,
IN OUT LPDWORD lpdwCurrentDirectory
);

Retrieves the current directory for the specified FTP session.

Returns TRUE if successful, or FALSE otherwise. To get the specific error message, callGetLastError.
hFtpSession
Valid handle to an FTP session.
lpszCurrentDirectory
Address of a buffer that receives the current directory string, which specifies the absolute path to the current directory. The string is null terminated.
lpdwCurrentDirectory
Address of a variable that specifies the length, in characters, of the buffer for the current directory string. The buffer length must include room for a terminating null character. Using a length of MAX_PATH is sufficient for all paths. When the function returns, the variable receives the number of characters copied into the buffer.
If the lpszCurrentDirectory buffer is not large enough, lpdwCurrentDirectory receives the number of bytes required to retrieve the full, current directory name.

cub 2002-10-09
  • 打赏
  • 举报
回复
第一个参数的声明是:HINTERNET* phFtpConn;
*phFtpConn应该是一个HINTERNET变量阿
guopo 2002-10-09
  • 打赏
  • 举报
回复
第一个参数是HINTERNET,不是指针。

16,549

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧