LearningCpp
asked on
Need to add mulltiple BSTR strings using C++
Hi,
I need to add multiple bstr strings using C++, I am aware to add bstr we can:
int lenBuffer;
BSTR bstr1,bstr2, bstr3,;
//assign some values to bstr's
lenBuffer = SysStringLen(bstr1) + SysStringLen(bstr2) + SysStringLen(bstr3);
BSTR bstrQuery;
bstrQuery = SysAllocStringLen(L"",lenB uffer+1);
wcscat_s(bstrQuery,lenBuff er+1,bstr1 );
wcscat_s(bstrQuery,lenBuff er+1,bstr2 );
wcscat_s(bstrQuery,lenBuff er+1,bstr3 );
is there any better way of doing it, I have around 6 bstr strings(or more) to concatenate, whats the best possible way of doing it?
TIA
I need to add multiple bstr strings using C++, I am aware to add bstr we can:
int lenBuffer;
BSTR bstr1,bstr2, bstr3,;
//assign some values to bstr's
lenBuffer = SysStringLen(bstr1) + SysStringLen(bstr2) + SysStringLen(bstr3);
BSTR bstrQuery;
bstrQuery = SysAllocStringLen(L"",lenB
wcscat_s(bstrQuery,lenBuff
wcscat_s(bstrQuery,lenBuff
wcscat_s(bstrQuery,lenBuff
is there any better way of doing it, I have around 6 bstr strings(or more) to concatenate, whats the best possible way of doing it?
TIA
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes, it will.
ASKER
#include
Will this work in pure win32 environment, currently I am developing in VS IDE 2005. but will have to port only to pure win32 api environment