?
Solved

exception - EoleSysError with message CoInitialize has not been called.

Posted on 1999-07-22
9
Medium Priority
?
1,313 Views
Last Modified: 2010-05-18
When i run my my program on Delphi 4 the exception was raised. Please help. co'z when i run it on delphi 3, no problem. but delphi 4 got problem..

Thank you.
0
Comment
Question by:n_chai
  • 4
  • 3
  • 2
9 Comments
 
LVL 10

Accepted Solution

by:
viktornet earned 200 total points
ID: 1390665
try this...

in OnCreate() of your form do this...

if CoInitialize(nil) <> S_OK then begin
  ShowMessage('Error initializing the COM library!');
  Halt;
end;

..-=ViKtOr=-..
0
 
LVL 10

Expert Comment

by:Lischke
ID: 1390666
Hi all,

this should be a bit generalized as n_chai's problem is very common for projects ported from D3 to D4. There's a new method Application.Initialize which is automatically placed as the first call into the project source when you create a new D4 application. This call is NOT automatically inserted wehn you are doing a port. Hence you have to insert it manually. This call is needed for the COM/OLE initialization as well as some other stuff (database etc.).

Ciao, Mike
0
 

Author Comment

by:n_chai
ID: 1390667
It say undeclared identifier coinitialize. please help.

Thank you.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
LVL 10

Expert Comment

by:viktornet
ID: 1390668
I've seen Application.Initialized;lin both my D3 and D4 projects.. ?!?!

btw, n_chai, try including ole2 or ole only in your uses clause...

even though that might not be the problem that ic causing it it might prevent it form the displaying that message and register the COM library...
0
 
LVL 10

Expert Comment

by:Lischke
ID: 1390669
So? It seems I mixed that with porting from D2 to D3. Sorry :-/

n_chai, you could still look into the project source to see if Application.Initialize is there. I'm interested to know if it is...

Ciao, Mike
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1390670
Mike, I didn't mean to offend you.. Just asked because I remember that i had that statement in both D3 & D4... that's all...
0
 
LVL 10

Expert Comment

by:Lischke
ID: 1390671
Hey Viktor :-)

I don't feel offended. You made a very true comment and I was wrong... What I just want to know is whether taking in the Initialize call into the project source will sovlve n_chai's problem. If it is there already then I made again a wrong assumption.

Great to discuss with you :-)

Ciao, Mike

0
 

Author Comment

by:n_chai
ID: 1390672
Application.initialize is not there. but after i put it in another message appear. eolesyserror - no such interface supported.  Please help.
0
 
LVL 10

Expert Comment

by:Lischke
ID: 1390673
Well, I can't cure your project from distance so can you send me the sources (maybe shortend to the smallest size which still produces the error) and I'll look into it.

Ciao, Mike

public@lischke-online.de
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Is your organization moving toward a cloud and mobile-first environment? In this transition, your IT department will encounter many challenges, such as navigating how to: Deploy new applications and services to a growing team Accommodate employee…
The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…
Suggested Courses

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question