Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2008 Mar : OleInitialize

www.cryer.info
Managed Newsgroup Archive

OleInitialize

Subject:OleInitialize
Posted by:"Marc Pelletier" (marc@stopspam.goldak.ca)
Date:20 Mar 2008 10:43:06

Hello,

I have a dll I wrote that has been basically unchanged for years. It uses
ADVStringGrid. Its at least a 5 year old version. Everythings been cool for
a long time.

This dll is used within a 3rd party win32 application (Geosoft) that also
has a command line processor. Today for the first time I tried using the
command line version and ADVStringgrid threw an exception in the
initialization section. The function in question is

procedure Initialize;
var
  Result : HResult;
begin
  Result := OleInitialize(Nil);
  Assert(Result in [S_OK, S_False], Format ('OleInitialize failed ($%x)',
[Result]));
end;

I've done a bit of reading and found that in general calling OleInitialize
within a statically linked dll is bad, but this has been working fine for
me up until now.

The difference is that my dll is being called from within a different
application, so I assume it is something wonky thats being done in there.

<wild hypothesis follows...>
It appears that the order of loading things is important, and maybe my
stuff is being called before the ole stuff within their app finishes its
own initialization. Does that make sense?
<end of wild hypothesis>

I don't have any control over the calling app, but if there is something I
can do environment wise I would happily do it. Or any info I could pass on
to the developers of the host app would also be appreciated.

Thanks,

Marc Pelletier
Goldak Airborne Surveys

Replies:

www.cryer.info
Managed Newsgroup Archive