Article View: borland.public.cppbuilder.nativeapi
Article #10333Re: trying to acces to a file by means of a link file
From: Frank Chisme
Date: Thu, 15 Apr 2004 11:21
Date: Thu, 15 Apr 2004 11:21
55 lines
2840 bytes
2840 bytes
Thank you Damon!
I will keep on struggling.
"Damon Chandler (TeamB)" <dmc27@cornell.edu> escribi� en el mensaje
news:4072adfa$1@newsgroups.borland.com...
> Hi Frank,
> The HRESULT value of -2147221008 corresponds to the error
> "CoInitialize() has not been called." You can determine this by
> including <ComObj.hpp>, and then by passing the return value of
> CoCreateInstance() to the OleCheck() VCL function. In this case,
> OleCheck(-2147221008) returns the string "CoInitialize() has not been
> called."
>
> So in your code, call...
>
> CoInitialize(NULL);
> //
> // add your code here...
> //
> CoUnintialize();
>
> Alternatively, you can call CoInitialize(NULL) in your form's
> constructor, and then call CoUninitialize() in the destructor.
>
> I read about the NO_WIN32_LEAN_AND_MEAN workaround in a post that
> someone had made to this group a while back. Apprarently, the
> workaround was mentioned in a README file that accompanied either BCB5
> or BCB6 (I don't recall which, and I don't usually read README files to
> closely :).
>
> Good luck,
> --
> Damon (TeamB)
>
>
> Frank Chisme wrote:
> > Hello Damon,
> >
> > Now my compiler doesn�t give an error (with the NO_WIN32_LEAN_AND_MEAN
> > conditional), but the function:
> >
> > if (SUCCEEDED(CoCreateInstance(CLSID_ShellLink,
> > NULL,CLSCTX_INPROC_SERVER,IID_IShellLink,(void **)&psl))) {
> >
> > gives an error (not SUCCEDDED). But I don�t know how to solve it, in
fact, I
> > even don�t know which the error is. All I have achieved is to know that
the
> > error si -2147221008
> >
> > And how did you figure out that it was mandatory to establish the
> > NO_WIN32_LEAN_AND_MEAN conditional?
Technical Details
Message-ID:
<407e6fa0$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<406c1fc2$1@newsgroups.borland.com> <406cbe4b$1@newsgroups.borland.com> <406d38cc$1@newsgroups.borland.com> <406d644f$1@newsgroups.borland.com> <40726d3a@newsgroups.borland.com> <4072adfa$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10cc67,a53a58dfad4a9f1a X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-04-15 04:39:34 PST From: "Frank Chisme" <frankchisme@hotmail.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <406c1fc2$1@newsgroups.borland.com> <406cbe4b$1@newsgroups.borland.com> <406d38cc$1@newsgroups.borland.com> <406d644f$1@newsgroups.borland.com> <40726d3a@newsgroups.borland.com> <4072adfa$1@newsgroups.borland.com> Subject: Re: trying to acces to a file by means of a link file Date: Thu, 15 Apr 2004 13:21:36 +0200 Lines: 57 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: 80.81.122.114 Message-ID: <407e6fa0$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1082027936 80.81.122.114 (15 Apr 2004 04:18:56 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail