Solved

Delphi and C++

Posted on 1998-11-05
3
234 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

808 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