I don't know if this will make any sense (I had too much wine and know [censored] about VB), but maybe it helps.
Compare your code to the c++ code
Code:
cds.lpData = lstrcpy(buffer, buffer)
' Copies filename to itself. Nothing happens, but returns the address for the pointer to the string!
If I understand correctly you put the adres of a pointer to buffer in lpData
Now here is the C++ code
Code:
adr=&buf;
cds.lpData=&adr;
Now if I understand this correctly (like I said before I don't know c++ either :D )
adr contains the adress of the pointer to buffer, but
lpData contains the adress of the pointer to the adres of the pointer to the buffer
I tried to fix it in VB6 and didn't succeed, but I hope this is somehow of use to you.
Rafke P.
EDIT:On a more sober note: this doesn't explain why the open file is working though.