Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

concatenating LPWSTR

Status
Not open for further replies.

Pyramus

Programmer
Dec 19, 2001
237
GB
I just want to concatenate two LPWSTR to get another LPWSTR.

LPWSTR output1, output2;

I've tried stuff like

wstring out = (*output1) + (*output2);
LPWSTR out = wcscat(output1, output2);

I can't get it to work. I'm trying to output the result using a message box.

MessageBox(NULL, W2T(out), NULL, NULL);


Any ideas?
 
How are you reading data into output 1 & 2? Did you allocate space for them? Is the data in them null terminated?

Matt
 
Yes, they have to be null-terminated by definition.

The data's been put in there by an API call (NetUserGetInfo if you're interested)- the memory is allocated automatically.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top