Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2006

Tip: Looking for answers? Try searching our database.

for those who still create COM servers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Egbert Nierop (MVP for IIS) - 25 Jul 2006 11:02 GMT
Boost BSTR performance by 3000%

http://technolog.nl/eprogrammer/archive/2006/07/25/1009.aspx
Bronek Kozicki - 25 Jul 2006 12:22 GMT
> Boost BSTR performance by 3000%
> http://technolog.nl/eprogrammer/archive/2006/07/25/1009.aspx

anyone willing to rewrite _bstr_t ? ;)

B.
Egbert Nierop (MVP for IIS) - 25 Jul 2006 13:43 GMT
>> Boost BSTR performance by 3000%
>> http://technolog.nl/eprogrammer/archive/2006/07/25/1009.aspx
>
> anyone willing to rewrite _bstr_t ? ;)

That would be a hard task :<

I've been looking into the source, and that one looks much more dependent on
tiny subroutines, while the member functions of CComBSTR are independently
written.
Whynot just use CComBSTR instead of _bstr_t  ?

in addition, CComBSTR2 also has methods like CString has (formatting), so if
you manipulate strings (in/out or retval) you even do not have to cast to
CString and BSTR back, thus again improving scalability. I only would like
someone to improve Join and Split on the CComBSTR2 class. These functions
are really slow.
Bronek Kozicki - 25 Jul 2006 15:05 GMT
> Whynot just use CComBSTR instead of _bstr_t  ?

maybe because _bstr_t is already in your project if you use #import? Or
because it's more const-safe than CComBSTR? Or because it does simple
and nice Unicode<>ANSI conversions?

B.
Egbert Nierop (MVP for IIS) - 25 Jul 2006 17:47 GMT
>> Whynot just use CComBSTR instead of _bstr_t  ?
>
> maybe because _bstr_t is already in your project if you use #import? Or

that would be 500bytes extra code on your compiled project ;-)

> because it's more const-safe than CComBSTR? Or because it does simple and
> nice Unicode<>ANSI conversions?

Possibly. I never do Unicode <-> ansi conversions since I simply never
develop for Win9x/ME :).

There are very nice ATL conversion macro's that do the task already. But
since I don't know _bstr_t  for sure, I cannot speak about this.
Bronek Kozicki - 25 Jul 2006 18:01 GMT
>> maybe because _bstr_t is already in your project if you use #import?
>> Or
>
> that would be 500bytes extra code on your compiled project ;-)

and yet another string class, with different ownership semantics than
others. Mistakes in ownership handling can be pretty expensive, if you
forget the semantics of class you use. Thus I simply do not use the ones
I do not really need.

>> because it's more const-safe than CComBSTR? Or because it does
>> simple and nice Unicode<>ANSI conversions?
>
> Possibly. I never do Unicode <-> ansi conversions since I simply never
> develop for Win9x/ME :).

I do use std::runtime_error (or actually my own classes derived from
thereof) and the problem is that it does not accept const wchar_t* :-(

B.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.