Home
Virtual Image Printer DriverMiraplacid Publisher converts documents to images
Virtual Text Printer DriverMiraplacid Text Driver extracts text from documents
PostScript Printer DriverMiraplacid PostScript Driver prints documents with your content inserted
Miraplacid Binary and Text DOM SDKMiraplacid Binary and Text DOM SDK - access to internal structure of a binary and text files
Common:   Login | Rules of forum | Register
Management:  New topic | Close topic | Move topic | Delete topic
  

Miraplacid Forum >> Software Development >> _bstr_t vs CComBSTR, _variant_t vs CComVariantModerator:XMan

Author Topic:  _bstr_t vs CComBSTR, _variant_t vs CComVariant
gamer
Member

From: Canada
posted 2004-05-14 12:10:25 Reply -Delete

Do you use _bstr_t and _variant_t or CComBSTR and CComVariant? Fucntionality looks pretty the similar, but _xxx_t has some extras. I use CComXXX cause ATL does ...
Does it make sense to switch? What you think?

stephany
Member

From: US
posted 2004-05-15 04:25:30 Reply -Delete

Do you use Visual Studio 6 or 7? In VS 6 _bstr_t is useless for programms other than Hello World. There is no Detach. In VS 7 - of course _bstr_t.

theory
Member

From: Suomi
posted 2004-06-04 09:29:29 Reply -Delete

It seems, Variant and BSTR wrappers have been written by different guys.
In _bstr_t Attach really attaches to the BSTR. In _variant_t it just make a copy and releases the original one which is disaster when you write put_something code.
CComVariant does not have such kind of problems, but ATL wrappers have another disease. CComBSTR::Copy makes a copy of the object while CComVariant::Copy does the opposit thing - it works like assignment operator.

Your message:
Name, password:
Go to category:  

Technical Support

Copyright © Miraplacid, 2003 - 2024