tags:

views:

33

answers:

1
double Time;
...
WriteFile( tmp_pipe, Time, sizeof(double), &dwWritten, NULL );

The above reports :

error C2664: 'WriteFile' : cannot convert parameter 2 from 'double' to 'LPCVOID'
+2  A: 

You want &Time, not Time, for parameter 2 of the function call.

Carl Norum
Thanks,do you know what `LPC` means in `LPCVOID`?
Long Pointer Const Void ? - basically a pointer to any data type.
John Boker
Long Pointer to a Constant void type. Basically just a pointer to constant data of any kind. Link: http://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx
Carl Norum
But `Time` isn't a constant in my case,how?
@user198729, in this case the function is indicating that it will not modify the contents of your buffer. As far as `WriteFile` is concerned, the data is constant. You don't need to worry about it changing during the call.
Carl Norum