The following function is as follows
DWORD * pBufferLength)
with explanation as follows
lpDeviceNameBuffer [out] Pointer to buffer that will store the returned device name
pBufferLength [in/out]Pointer to a variable that specifies the size, in bytes, of the buffer pointed to by the lpDeviceNameBuffer parameter. When the function returns, this variable contains the size of the data copied to lpDeviceNameBuffer
I under stand pointer points to address and I understand that dereference points to value at an address. But these Windows API functions have me confused, expecially with the out in/out stuff.
Can anyone make this clearer using the above function as example.
I would code
Based on your description David's code does exactly what is necessary; can you explain exactly what happens? Please remember to post your sample within the "code block" <pre></pre> tags to make it easier to read.
When I changed the char to TCHAR the code worked. I'm coding for windows ce and that was the difference.
Where I'm really confused it LPTSTR lpDeviceNameBuffer is pointer to a buffer to store the returned device name. How do I know what datatype to use for the buffer. It's not like
char *pdata is a pointer to
because the datatype is LPTSTR
Its hard to say what your function does without seeing some documentation. But I suspect it is a dynamic sized buffer and when the functions fails it probably returns the size required. Something like this:
With regard to the above functions 1st parameter LPTSTR lpDeviceName [out] pointer to buffer that will store the returned device name.
What exactly does that mean? I think it means to declare a variable of type LPTSTR which is defined as a pointer to a buffer to store the returned device name. And the buffer is built into the function itself. Am I wrong?
Does is mean to actually delare a LPTSTR pointer and another buffer variable that it will point to?
Thanks. That make sense and that's what I thought. Can you help me with the dataTypes. I pretty confused on this. For example.
Function says LPTSTR lpDeviceNameBuffer is pointer to buffer. But what datatype must the buffer be. This is where I'm really having problems. It's not like
where you know that the variable is a char and the pointer is a char.
I want to ask you that what are the different manners to run a file auto in WindowsXP and Linux? Is auto run of any file is possible in Linux? Is there any other method in windowsXP to run a file auto(makeing a autorun.inf file)?