?
Solved

Using a Visual Basic ActiveX dll in Delphi

Posted on 2000-04-13
5
Medium Priority
?
211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 400 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

762 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