This is the line which is in error. Because you are performing a reinterpret_cast it will copy the pointer value but not correctly create the rest of the BSTR class, notably the length which occurs before the string array.
My solution would be to change the return type to the WIDE CHAR type the same as lpszW.
I want to make a desktop application exactly like webshot from scratch but dont know how to start.
If some one could give me link for such a project it would be of great help.
I want to use MFC.
Thanks In advance.