Re: C++ Library needed in Delphi App
- From: "Remy Lebeau \(TeamB\)" <no.spam@xxxxxxxxxxx>
- Date: Fri, 30 Nov 2007 12:05:18 -0800
"Dan" <frozendice@xxxxxxxxx> wrote in message
news:47506714@xxxxxxxxxxxxxxxxxxxxxxxxx
When there is a library in, let's say C++ and you want to use it in
a Delphi application isn't it possible to make that library into a dll
(assuming you have the source code), then access the dll's functions
from Delphi?
Yes, provided the functions are exported using calling conventions and data
types that Delphi supports.
I need to do this with the NCL NeXus reading/writing library
which is written in C++, anyone know of a guide or any source
which might explain how I could wrap up this library into a dll?
NCL is designed to be used as a static .lib file that is compiled directly
into a C++ executable. It is not designed to be compiled into its own DLL
as-is. Also, all of its functionality is implemented as classes, which
can't be exported from a DLL. And some of the class method paramters and
data members use the STL, which Delphi can't use at all. So, to do what you
are asking, you will have to first compile NCL to a .lib file, then create a
separate DLL project that includes that .lib file, and have the DLL export
its own flat functions that wrap the desired class operations. Only then
will Delphi be able to use it.
Gambit
.
- Follow-Ups:
- Re: C++ Library needed in Delphi App
- From: Dan
- Re: C++ Library needed in Delphi App
- References:
- C++ Library needed in Delphi App
- From: Dan
- C++ Library needed in Delphi App
- Prev by Date: Re: C++ Library needed in Delphi App
- Next by Date: Re: C++ Builder BPLs loaded into Delphi
- Previous by thread: Re: C++ Library needed in Delphi App
- Next by thread: Re: C++ Library needed in Delphi App
- Index(es):
Relevant Pages
|