TC中如何创建、调用DLL?有例子最好,解决后加分!

WYJBCB 2003-08-21 03:09:11
同上
...全文
289 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
WYJBCB 2003-08-22
  • 打赏
  • 举报
回复
TO chon81(当我遇上你…)
我怎么调用system函数,调用DOS命令DEL删除里面的文件.
能不能给段代码?谢谢
yzb1000 2003-08-22
  • 打赏
  • 举报
回复
C#里删除文件就不要用什么dos调用了吧
用API呀
BOOL DeleteFile(
LPCTSTR lpFileName // file name
);
Parameters
lpFileName
[in] Pointer to a null-terminated string that specifies the file to be deleted.
Windows NT/2000/XP: In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to nearly 32,000 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see File Name Conventions.

Windows 95/98/Me: This string must not exceed MAX_PATH characters.

Return Values
If the function succeeds, the return value is nonzero.

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

Remarks
If an application attempts to delete a file that does not exist, the DeleteFile function fails.

To delete or rename a file, you must have either delete permission on the file or delete child permission in the parent directory. If you set up a directory with all access except delete and delete child and the ACLs of new files are inherited, then you should be able to create a file without being able to delete it. However, you can then create a file, and you will get all the access you request on the handle returned to you at the time you create the file. If you requested delete permission at the time you created the file, you could delete or rename the file with that handle but not with any other.

Windows 95/98/Me: The DeleteFile function deletes a file even if it is open for normal I/O or as a memory-mapped file. To prevent loss of data, close files before attempting to delete them.

Windows NT/2000/XP: The DeleteFile function fails if an application attempts to delete a file that is open for normal I/O or as a memory-mapped file.

To close an open file, use the CloseHandle function.

Windows 95/98/Me: DeleteFileW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.

紫郢剑侠 2003-08-22
  • 打赏
  • 举报
回复
1998年的软件报里有篇文章所介绍的技术好像可以解决这个问题.
chon81 2003-08-21
  • 打赏
  • 举报
回复
1你可以用system函数,调用DOS命令DEL删除里面的文件.
2把目录里面的文件一个一个的检索,找到一个删一个了.
3把该目录删了,再建一个同名目录啊.
wbh0360 2003-08-21
  • 打赏
  • 举报
回复
为何不用 vc?!
WYJBCB 2003-08-21
  • 打赏
  • 举报
回复
To chon81(当我遇上你…) :兄:
您好,那我问再一下,我怎么在指定目录下删除已有的文件呢?
chon81 2003-08-21
  • 打赏
  • 举报
回复
我没试过,用C#调用TC内的数据,也不知道有什么直接的方法,
不过.你可以把数据放到一个文件里面,
再用C#或CB去读取.
WYJBCB 2003-08-21
  • 打赏
  • 举报
回复
那我想让C#或CB调用TC内的数据,我该怎么做呢?
TC内传出的数据是String类型
chon81 2003-08-21
  • 打赏
  • 举报
回复
TC中是直接不能创建,调用DLL,
因为,TC是16位DOS里面的,DLL是32位的WINDOWS里面的.

69,369

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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