<p>Here's the code I want to speed up.   It's getting a value from an ADO recordset and converting it to a char*.   But this is slow.    Can I skip the creation of the _bstr_t?</p>

<pre><code>                _variant_t var = pRs-&gt;Fields-&gt;GetItem(i)-&gt;GetValue();

                if (V_VT(&amp;var) == VT_BSTR)
                {
                    char* p = (const char*) (_bstr_t) var;
</code></pre>

This creates a temporary on the stack:
```
```
USES_CONVERSION;
char *p=W2A(var.bstrVal);
```
```
This uses a slightly newer syntax and is probably more robust. It has a configurable size, beyond which it will use the heap so it avoids putting massive strings onto the stack:
```
```
char *p=CW2AEX<>(var.bstrVal);
```
```