Click to See Complete Forum and Search --> : Is OLE2CT valid when used with BSTR


anand99
May 14th, 1999, 08:44 AM
I am using BSTRs in my application in several places. In some situations I want to go back and forth between BSTRS and LPCTSTRs to go from BSTR to LPCTSTR I use the macro OLE2CT. Is this the correct macro to use for this conversion? Or does this not apply to BSTRs

mdwilliams
May 14th, 1999, 09:57 AM
A BSTR is simply an OLECHAR* with a prepended size. In other words, you can treat a BSTR as an OLECHAR* just not the other way around.

So, you can use any of the OLE2xxx conversion macros on a BSTR.

-- Matt