C++ DLL's in Delphi

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi there

Just a plea for help , anyone know any good sources of information about how to use a C++ DLL in Delphi? (a bit of background I've received the REX2 DLL for use in my beat-slicer Dicer, however this DLL is in C++ and Dicer is programmed in Delphi). If anyone knows anything I would be most greatful

Cheers

Jon : ConcreteFX

Post


Post

double post

Post

Concretefx wrote:Just a plea for help , anyone know any good sources of information about how to use a C++ DLL in Delphi? (a bit of background I've received the REX2 DLL for use in my beat-slicer Dicer, however this DLL is in C++ and Dicer is programmed in Delphi). If anyone knows anything I would be most greatful
It's basically a case of doing standard dll import stuff and matching up calling conventions. At the worst a C++ wrapper may be needed to map to C++ only call types (as I had to do with ASIO). Mail me with details of the exposed C++ interface if you want some more specific help!

Martin

Post

Hi

Thanks for the advice, I might get back to you MadGav about C++ DLL's , I'll see how things go

Cheers

Jon : ConcreteFX

Post

Jon

do you have the header files?

If you look on sourceforge, there is a header file translator (I think it's part of JEDI). There are others around, google for C2PAS.

You will just have to have the standard declarations (like windows.pas has), and you may find that rather than stdcall, you may have to use cdecl at the end of the declaration.

But basically it's a dll - could be written using anything (tho' I don't think many LOGO interpreters dish out dlls...) - you just need to know the calling convention, the procedure name, and the parameters.

Oh, and I'm making an assumption that it is a standard dll, rather than exposing COM objects and the like. If it is an ActX dll, you can import the TypeLibrary, or use CreateOLEObject to access the registered objects... But for reading REX files - I doubt it!

HTH
DSP
Image

Post

Hi there

Thanks again for the tips, I've managed to find a program called HeadConv that supposed to convert the C++ header file into Delphi. I'll have to experiment with this and see what happens. I suppose that's the problem with programming in Delphi when the majority programs in C++

Cheers

Jon : ConcreteFX

Post

It ends up being necessary to be able to read C++, if not be comfortable writing it. Header translations tend to be mostly drudge, with occasional head scratching. The thing that can really throw a spanner in the works is non-standard calling conventions (i.e. internal compiler ones).

Post Reply

Return to “DSP and Plugin Development”