[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 125
  • Last Modified:

OLE Exception when calling an external COM exe from a Web Server Project

I have a database at the back-end,
a VB COM exe accessing the DB, and a delphi Web Server Project calling the VB COM object (by importing type lib), and a web front-end calling the delphi app.
I made a dummy delphi program to call the VB app to get data from the DB and it worked fine, but now when I use a Web Server Project and call from IExplorer, it returns with an OLE Object creation error.
It can no longer create the object defined within the Type Library...

  • 2
1 Solution
What is the detailed error message?
You could try adding a call to COInitialize(Nil); in the initialization section of an appropriate unit. The Web Server Project _may_ not call this automatically.


ma8yrAuthor Commented:
I found a solution to this the night I put this question on the web,

rWilson is correct, borland put the coInitialize call in the application.initialize section of all projects, but for whatever reason they missed it out of the web server project, so the answer to this problem is to add the coInitialize call before trying to create you're COM class.
ma8yrAuthor Commented:
You have the right answer so I feel obliged to give you some points even though I found the answer before I read you're comment, so here you go.

ThanX anyway,


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now