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

WYJBCB 2003-08-21 03:09:11
同上
...全文
296 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里面的.
国际学术期刊Science/AAAS和英特尔在全球首次联袂推出第一季《架构师成长计划》以来,吸引了无数架构师踊跃参与,获得业内广泛赞誉。为持续助力架构师把握数智机遇,构建未来,第二季《架构师成长计划》全新升级,强势归来!业内顶尖架构师大咖齐聚,为架构师群体量身打造系统成长课程,带来涵盖云游戏、云原生、联邦学习、生信大数据、算力网络、云网融合等多个热门话题的前沿技术及案例实践。第一期:超视频时代 音视频架构建设与演进复制链接收看完整内容:https://bizwebcast.intel.cn/eventstart.aspx?eid=298&tc=yxq0921l2d&frm=csdn_2第二期:转化医学研究背景下的高性能计算平台复制链接收看完整内容:https://bizwebcast.intel.cn/eventstart.aspx?eid=311&tc=pzw21rx59o&frm=csdn_2第三期:联邦学习的研究与应用实践复制链接收看完整内容:https://bizwebcast.intel.cn/eventstart.aspx?eid=315&tc=0e8trfvt8i&frm=csdn_2第四期:用架构思维为云原生做减法复制链接收看完整内容:https://bizwebcast.intel.cn/eventstart.aspx?eid=316&tc=i2kgf55ggn&frm=csdn_2第五期:网络智能化技术与演进复制链接收看完整内容:https://bizwebcast.intel.cn/eventstart.aspx?eid=322&tc=ckhvmonqvb&frm=CSDN_2第六期:异构计算 数据心“芯”变革复制链接收看完整内容:https://bizwebcast.intel.cn/eventstart.aspx?eid=325&tc=mzppx1h6ri&frm=csdn_2第七期:筑算力,话东西复制链接收看完整内容:https://bizwebcast.intel.cn/eventstart.aspx?eid=327&tc=gwb7n8x79n&frm=csdn_2第八期:AI驱动的生命科学创新范式之变复制链接收看完整内容:https://bizwebcast.intel.cn/eventstart.aspx?eid=328&tc=zircyqwy9u&frm=csdn_2第九期:软硬一体实现数据库性能优化复制链接收看完整内容:https://bizwebcast.intel.cn/eventstart.aspx?eid=348&tc=4a46kfrb0o&frm=csdn_2第十期:AI规模化应用时代的深度学习平台构建复制链接收看完整内容:https://bizwebcast.intel.cn/eventstart.aspx?eid=349&tc=fm9a1mrumb&frm=csdn_2

69,382

社区成员

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

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