Re: C++ Library needed in Delphi App
- From: "Dan" <frozendice@xxxxxxxxx>
- Date: Fri, 30 Nov 2007 13:27:44 -0700
Well I figured I might have to write some wrapper functions, but for my current project I must be able to read NeXus format. Do you know of any other API's or any other way I could read NeXus files? It's been ages since I used C++ but I'll try to remember how to do some of this stuff in the mean time. Thank you for the reply Remy.
- Dan
"Remy Lebeau (TeamB)" <no.spam@xxxxxxxxxxx> wrote in message news:47506d48$1@xxxxxxxxxxxxxxxxxxxxxxxxx
"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: Remy Lebeau \(TeamB\)
- Re: C++ Library needed in Delphi App
- References:
- C++ Library needed in Delphi App
- From: Dan
- Re: C++ Library needed in Delphi App
- From: Remy Lebeau \(TeamB\)
- C++ Library needed in Delphi App
- Prev by Date: Re: C++ Builder BPLs loaded into Delphi
- Next by Date: Re: Quad Core or Dual Core
- Previous by thread: Re: C++ Library needed in Delphi App
- Next by thread: Re: C++ Library needed in Delphi App
- Index(es):
Relevant Pages
|