Re: How to convert CString to VARIANT ?



VARIANT va;
va.vt=VT_BSTR;
CString str=.....;
va.bstrVal = str.allocsysstring();

At last , use sysfreestring to free

"Jigar Mehta" <jigar.programmer@xxxxxxxxx> wrote in message
news:1141323520.444604.52870@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I have one CString object, I want to pass that to an activeX control
method which takes [VARIANT *] as an argument.. so, how to convert
cstring to VARIANT * ??

Jigar



.