Solved

Using a Visual Basic ActiveX dll in Delphi

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
delphi prevent click fast 2 216
How to renew a Delphi rad-studio licence? 5 64
control image tags in a string ? 12 129
how to update exe applicatio from internet ? 6 77
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

770 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