NomanAhmed
asked on
using variable value in SysAllocString(L"6393570000001130"); inplace of Hard coded "6393570000001130" in C++
I need to call SysAllocString() function and get BSTR value I have a code like this
BSTR Key = SysAllocString(L"639357000 0001130");
long resultFromVB = t->ShowForm(&Key);
in above code I dont want to hard coded value "6393570000001130" instead of this I want to put variable in it which is updated dynamically when this method is called in which above code is written
for example
string ABC(string str){
BSTR Key = SysAllocString(Lstr);
long resultFromVB = t->ShowForm(&Key);
}
when I do above this I get an error what should I do
BSTR Key = SysAllocString(L"639357000
long resultFromVB = t->ShowForm(&Key);
in above code I dont want to hard coded value "6393570000001130" instead of this I want to put variable in it which is updated dynamically when this method is called in which above code is written
for example
string ABC(string str){
BSTR Key = SysAllocString(Lstr);
long resultFromVB = t->ShowForm(&Key);
}
when I do above this I get an error what should I do
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use A2T,A2OLE Macros for conversion
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B138813