?
Solved

exception - EoleSysError with message CoInitialize has not been called.

Posted on 1999-07-22
9
Medium Priority
?
1,269 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

718 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