🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4227

Re: Positioning the SHBrowseForFolder window

#4227
From: Dennis Jones
Date: Wed, 08 Mar 2006 16:32
38 lines
2604 bytes
"JD" <nospam@nospam.com> wrote in message
news:440ec104$1@newsgroups.borland.com...
>
> "Dennis Jones" <nospam@nospam.com> wrote:
> >
> >From MSDN:
> >
> > [...] To use this flag, you must call OleInitialize or
> > CoInitialize before calling SHBrowseForFolder.
> >
> > [...] I suspect if it hasn't been called already by some
> > library you are using, that you will have to call it
> > yourself.
>
> Andrue said exactly the same thing (did you google?)

Huh?

> but I
> couldn't get it to fail. I know ... just because it didn't
> break doesn't mean that it ain't broke. Besides, MS has
> always had reliable docs ... right?

I don't remember the details (it's been a couple years since I wrote that
code), but I do remember that sometimes it was needed and other times it
wasn't.  So, to be safe, I included the CoInitialize call because I couldn't
be certain when it wasn't required, and it didn't seem to hurt anything if
it was called redundantly.  IIRC, whether it was needed was dependent on
whether or not some other API or library call(s) had been made beforehand
(or maybe if some certain DLL had been loaded by another application in the
system), but I have no recollection of what might have initialized things to
the point where I didn't need it.  Also, when I wrote that code, I was still
using NT 4, so it could also have been an artifact of using that OS; whereas
it might never be needed in XP (which I presume most people use nowadays) --
I just don't know.

- Dennis
Technical Details
Message-ID: <440f0716$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <440cc788$1@newsgroups.borland.com> <440cd987$1@newsgroups.borland.com> <440d053b$1@newsgroups.borland.com> <440d30ca@newsgroups.borland.com> <440db652$1@newsgroups.borland.com> <440ec104$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,722adf2ba600e8df
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Dennis Jones" <nospam@nospam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <440cc788$1@newsgroups.borland.com> <440cd987$1@newsgroups.borland.com> <440d053b$1@newsgroups.borland.com> <440d30ca@newsgroups.borland.com> <440db652$1@newsgroups.borland.com> <440ec104$1@newsgroups.borland.com>
Subject: Re: Positioning the SHBrowseForFolder window
Date: Wed, 8 Mar 2006 08:32:24 -0800
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 204.200.27.7
Message-ID: <440f0716$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1141835542 204.200.27.7 (8 Mar 2006 08:32:22 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail