Solved

Delphi and C++

Posted on 1998-11-05
3
224 Views
Last Modified: 2010-04-04
When I call a certain procedure in a DLL I have been given, I get a C++ object whose methods I must call to perform the functions which I desire. How do I handle the C++ object in a Delphi environment? I have written a c++ module, but on linking with {$L file.obj} I get an "invalid format" message!
0
Comment
Question by:BigRat
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
Thaddy earned 100 total points
ID: 1345762
Your dll is probably written with Microsoft C++
Th object format is COFF and is not (directly) supported by Delphi.
My work around is this:
Load your delphi files in C++Builder 3 (Builder can compile pas files) then, on je project options|Advanced compiler, set MFC compatibility on and output C++ Object files (.obj).
C++ Builder 3 supports COFF, so your application now will compile.
If you use any d4 options: Bad luck, c++Builder won't compile that stuff


0
 
LVL 27

Author Comment

by:BigRat
ID: 1345763
I actually don't have c++Builder, just Delphi 3 and Microsoft C++ Subscription, but the fact that file file is COFF format explains the error. I'll just try something else....
      rats!!!!
0
 
LVL 2

Expert Comment

by:Thaddy
ID: 1345764
You can probably convert the header file to the dll with drBob's headerconvert utility.
Then you can almost certainly use the dll from Delphi.
It's on most good delphi sites or on http://www.drbob42.com/delphi/default.htm
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

Title # Comments Views Activity
Can't connect to Outlook via TOutlookApplication component 15 118
code issue 8 99
Printing problem 2 80
Unique identifier on a terminal server (rdp) 4 46
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

919 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

16 Experts available now in Live!

Get 1:1 Help Now