C++ DLL's in Delphi
-
- KVRist
- Topic Starter
- 361 posts since 6 Feb, 2003 from UK
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
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
-
- KVRist
- 290 posts since 30 Aug, 2002
Maybe this could be something:
http://www.howtodothings.com/showarticl ... rticle=285
http://www.howtodothings.com/showarticl ... rticle=285
-
- KVRian
- 513 posts since 9 Nov, 2000
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!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
Martin
-
- KVRist
- Topic Starter
- 361 posts since 6 Feb, 2003 from UK
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
Thanks for the advice, I might get back to you MadGav about C++ DLL's , I'll see how things go
Cheers
Jon : ConcreteFX
-
- KVRAF
- 8388 posts since 11 Apr, 2003 from back on the hillside again - but now with a garden!
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
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
-
- KVRist
- Topic Starter
- 361 posts since 6 Feb, 2003 from UK
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
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
-
- KVRian
- 513 posts since 9 Nov, 2000
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).