I have a C++ DLL that I wrote that has a single exposed function, that takes a function pointer (callback function) as a parameter.
#define DllExport extern "C" __declspec( dllexport )
DllExport bool RegisterCallbackGetProperty( bool (*GetProperty)( UINT object_type, UINT object_instnace, UINT property_identifer, UINT device_identifier, float * value ) ) {
// Do something.
}
I want to be able to call this exposed C++ DLL function from within a Delphi application and register the callback function to be used at a future date. But I am unsure of how to make a function pointer in Delphi that will work with the exposed C++ DLL function.
I have the Delphi application calling a simple exposed c++ DLL functions from the help I got in this question.
I am building the C++ DLL and I can change its parameters if needed.
My questions are:
- How to I create a function pointer in Delphi
- How to I correctly call the exposed C++ DLL function from within a Delphi application so that the C++ DLL function can use the function pointer.