[Webinar] Streamline your web hosting managementRegister Today

x
  • 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...

why????
0
ma8yr
Asked:
ma8yr
  • 2
1 Solution
 
MadshiCommented:
What is the detailed error message?
0
 
rwilson032697Commented:
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.

Cheers,

Raymond.
0
 
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.
0
 
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,

Mat
0

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