Solved

Using a Visual Basic ActiveX dll in Delphi

Posted on 2000-04-13
5
200 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

863 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

23 Experts available now in Live!

Get 1:1 Help Now