BOOL FindNextFile( HANDLE hFindFile, // search handle LPWIN32_FIND_DATA lpFindFileData // data buffer ); Parameters hFindFile [in] Search handle returned by a previous call to the FindFirstFile function. lpFindFileData [out] Pointer to the WIN32_FIND_DATA structure that receives information about the found file or subdirectory. The structure can be used in subsequent calls to FindNextFile to refer to the found file or directory.
HANDLE hFindFile, // search handle
LPWIN32_FIND_DATA lpFindFileData // data buffer
);
Parameters
hFindFile
[in] Search handle returned by a previous call to the FindFirstFile function.
lpFindFileData
[out] Pointer to the WIN32_FIND_DATA structure that receives information about the found file or subdirectory. The structure can be used in subsequent calls to FindNextFile to refer to the found file or directory.
bool SendDataNext(){...}
bool SendDataNext(){gi_enumID++...}
还有,你到底是问Windows API还是MFC啊?
MFC都是类,状态当然可以保存在类中的成员变量里头。
Windows API可以使用全局变量,也可以使用函数局部的静态变量。
bool SendDataNext(){gi_enumID++...}
不能这么简单的,多线程的话,甚至不是多线程,连续调用两次SendDataFirst你就死定了。
应该定义一个结构存储数据,SendDataFirst的时候new一个这个结构,返回该结构指针,SendDataNext把这个指针作为参数,最后还应该定义一个SendDataEnd函数,把这个指针释放。
例:
int* SendDataFirst(){int* gi_enumID=new int;* gi_enumID=0;...}
bool SendDataNext(int* lpi){*lpi++...}
bool SendDataEnd(int*lpi){delete lpi...}
当然还得加指针有效性判断
bool SendDataFirst(){gi_enumID++;...}
bool SendDataNext(){gi_enumID++...}