Solved

Using a Visual Basic ActiveX dll in Delphi

Posted on 2000-04-13
5
199 Views
Last Modified: 2010-04-04
I have read how to use a Visual Basic Active X dll in Delphi on Borland;s delphi WEB pages.  I followed there instructions, but recieve this error.

"Project TestConfig.exe raised exception class EOleSysError with message 'Colnitialize has not been called'.  Process Stopped. Use Step or Run to Continue."

Here is my code:
var
  testconfig: Variant;

testconfig := CreateOleObject('Configurator.InferenceEngine');

I have search delphi help and the WEB for this error message with no luck.  Any ideas?



0
Comment
Question by:ailts
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 100 total points
ID: 2713218
hi,
try add Application.Initialize; in the DPR-File:
 
begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.


or add at bottom of your unit:

initialization
  CoInitialize(nil)
finalization
  CoUnitinialize;
end.

Regards Barry

0
 
LVL 17

Expert Comment

by:inthe
ID: 2713223
ps,
for second method you may need add "activex" to the uses section.
0
 

Author Comment

by:ailts
ID: 2713354
Why was that line not generated automatically like it was supposed to be?

0
 

Author Comment

by:ailts
ID: 2713383
To clarify my previous comment.  Why was the line "Application.Initialize;" not generated automatically?  I was under the impression that you did not need to edit the project file at all.  this line was all I needed to add to my code to get it to run.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2713393
usually you would use the second method but first also works sometimes.
it is not needed for many apps to have this,for d5 anyway half the apps that need this use comobj which does this inside itself.

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now