菜鸟50分求教(在线等待)

ysu_hdhy 2005-05-18 07:36:34
我是个绝对新手,现在我刚学sdk,正在练习做个程序,要求是这样的
1把系统当前可以用的盘列出来(如c: d: e: 等等)
2选择某一盘符,把该系统盘下当前目录和文件列出来.
3选择某一目录需要列出该目录下一层的目录和文件
4可以回到上一层目录

我现在的思路是先把窗口做出来在进行布件
请大家帮我看看编程的思路是什么?如何使用控件?
因为新手,问题问的比较简单
希望大家详细的介绍一下
谢谢
...全文
162 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
ysu_hdhy 2005-05-19
  • 打赏
  • 举报
回复
是否需要使用SetCurrentDirectory函数
谢谢
ysu_hdhy 2005-05-19
  • 打赏
  • 举报
回复
再次求助!~GetLogicalDriveStrings函数的具体用法
谢谢
ysu_hdhy 2005-05-19
  • 打赏
  • 举报
回复
TO zottff()
请问GetLogicalDriveStrings函数的具体用法在那里能找到阿
谢谢
dsgsos 2005-05-19
  • 打赏
  • 举报
回复
不管我不会不会都要为兄弟们顶一下呀。
zottff 2005-05-19
  • 打赏
  • 举报
回复
相关函数:
GetLogicalDriveStrings
FindFirstFile
FindNextFile

用GetLogicalDriveStrings得到盘符,当选中盘符后,用FindFirstFile得到第一个文件或目录,然后利用循环和FindNextFile函数得到其余文件(包括目录)
ysu_hdhy 2005-05-19
  • 打赏
  • 举报
回复
再次求助!~
谢谢
ysu_hdhy 2005-05-19
  • 打赏
  • 举报
回复
to zottff()
谢谢
这里也谢谢其他兄弟!~
发分了
zottff 2005-05-19
  • 打赏
  • 举报
回复
我感觉GetLogicalDriveStrings应该更方便吧
ysu_hdhy 2005-05-19
  • 打赏
  • 举报
回复
GetLogicalDrives函数与GetLogicalDriveStrings使用起来那个更方便?
zottff 2005-05-19
  • 打赏
  • 举报
回复
也可以使用GetLogicalDrives函数
zottff 2005-05-19
  • 打赏
  • 举报
回复
SetCurrentDirectory 可以使用,但这样修改了当前目录,不过编程上能简单一些,不过可以先保存当前目录,完毕后在恢复当前目录
zottff 2005-05-19
  • 打赏
  • 举报
回复
GetLogicalDriveStrings
The GetLogicalDriveStrings function fills a buffer with strings that specify valid drives in the system.

DWORD GetLogicalDriveStrings(
DWORD nBufferLength, // size of buffer
LPTSTR lpBuffer // pointer to buffer for drive strings
);

Parameters
nBufferLength
Specifies the maximum size, in characters, of the buffer pointed to by lpBuffer. This size does not include the terminating null character.
lpBuffer
Pointer to a buffer that receives a series of null-terminated strings, one for each valid drive in the system, that end with a second null character. The following example shows the buffer contents with <null> representing the terminating null character.
c:\<null>d:\<null><null>

Return Values
If the function succeeds, the return value is the length, in characters, of the strings copied to the buffer, not including the terminating null character. Note that an ANSI-ASCII null character uses one byte, but a Unicode null character uses two bytes.

If the buffer is not large enough, the return value is greater than nBufferLength. It is the size of the buffer required to hold the drive strings.

If the function fails, the return value is zero. To get extended error information, use the GetLastError function.

函数的用法vc的帮助中都有啊?
ysu_hdhy 2005-05-18
  • 打赏
  • 举报
回复
可是这个要求在sdk下实现的
请问怎么处理?
jerry 2005-05-18
  • 打赏
  • 举报
回复
你说的这个还是比较烦杂的. 我在MFC下实现过. 可以看看我的 BLOG:

http://blog.csdn.net/krh2001/
ysu_hdhy 2005-05-18
  • 打赏
  • 举报
回复
请告诉实现的具体过程和使用那个函数
谢谢
ysu_hdhy 2005-05-18
  • 打赏
  • 举报
回复
是的
请问我还用不用对话框了,或者直接在窗口上布置控件阿?
谢谢
Hendy_So 2005-05-18
  • 打赏
  • 举报
回复
你的要求就是做一个内似资源管理器的查看程序,right?
控件肯定是使用listctrl了。

16,551

社区成员

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

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

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