Passing LPWSTR as Reference in a method in C++

355 Views Asked by At

I am passing LPWSTR as a reference in a method. The value remains in method but in callee function, it gets lost. I suspect I need to give some memory to LPWSTR but I am unable to figure out the method to do it. This is how my code looks like:

ValidateUrl(LPCWSTR wzSomeUrl, LPWSTR& DecodeUrlOut) {

    /* 
     I decode wzSomeUrl and put value in DecodeurlOut
    */

}

LPWSTR DecodeUrlOut = NULL;
ValidateUrl(wzSomeUrl , DecodeUrlOut);

I debug and find that DecodeUrlOut's value is L"".

0

There are 0 best solutions below