Solved

Delphi and C++

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 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

13 Experts available now in Live!

Get 1:1 Help Now