According to MSDN, using T2OLE in a loop may lead to stack overflow, my application uses T2OLE lot of places in the code inside loop for string conversion. I found that usingATL 7.0 string conversion classes and macros has lot of benefits and it solves the stack overflow issue as well,
I tried using the ATL 7.0 as below,
I found that CT2OLE in ATL 7.0 is equivalent to T2OLE but when I replaced T2OLE with CT2OLE I am getting this issue
Error: No suitable user defined conversion from "ATL:CA2W" to Cstring exists
In the same way I have an other place where it does cstring to _bstr_t and when i replace over there I am getting this
Error: No suitable user defined conversion from "ATL:CA2W" to _bstr_t exists
Can any one help me with this issue?
I tried using the ATL 7.0 as below,
_bstr_T example("Hello world"); for(i=o; i<10000; i++) { Callsomemethod(i,T2OLE(example)); //This is where I need to replace T2OLE } void Callsomemethod(int k, cstring y) { .... }
I found that CT2OLE in ATL 7.0 is equivalent to T2OLE but when I replaced T2OLE with CT2OLE I am getting this issue
Error: No suitable user defined conversion from "ATL:CA2W" to Cstring exists
In the same way I have an other place where it does cstring to _bstr_t and when i replace over there I am getting this
Error: No suitable user defined conversion from "ATL:CA2W" to _bstr_t exists
Can any one help me with this issue?