我有一个结构:传递结构的功能用C
PROCESSENTRY32 pe32;
我想这个结构传递给函数。该函数将创建一个文件并将结构中的数据写入该文件。函数的名称是takeinput()。我通过结构功能:
errflag = takeinput (&pe32)
;
在takeinput(PROCESSENTRY32 * pe31)中,我使用createfile()创建了一个文件D:\ File.txt。现在我必须将日期写入file.txt。我正在使用:
WriteFile(
hFile, // open file handle
DataBuffer, // start of data to write
dwBytesToWrite, // number of bytes to write
&dwBytesWritten, // number of bytes that were written
NULL); // no overlapped structure
这里h文件我知道。后三个我知道。但我对DataBuffer参数感到困惑。什么通过那里?结构pe31中有许多变量。有人可以帮我吗?
如果还有另一种方法将结构的数据写入file.txt,请给我解释一下。提前致谢。
为什么你的文件名是file.txt,你想用二进制格式还是文本写数据? – honibis 2011-01-10 09:41:54