战魂小筑

游戏,架构,客户端,渲染,服务器
对GetOpenFileName函数很无语

如果你用过GetOpenFileName中的OPENFILENAME的lpstrFilter参数,你会发现很无语

Pointer to a buffer containing pairs of null-terminated filter strings. The last string in the buffer must be terminated by two NULL characters.

看似没问题,但是在使用中却弊病很多:

1. 像脚本这类以0结尾,默认就根本不能传字符串给这个函数进行filter的配置

2. 即便lua这类函数提供了lstring的支持,但也极为麻烦,需要在buffer后添加一个\0

3. 调试器里只能看到第一个\0结尾的字符串

 

真不知道这是MS哪个脑残写的API,为什么不定制下filter,或者干脆用别的方式来传递。。。

posted on 2009-07-21 14:19  黑色灵猫  阅读(279)  评论(0编辑  收藏  举报