My current Delphi application is compiled as an ActiveX control and is called from a WinForms project. We wish to replace the ActiveX wrapper with Hydra.
Currently the following is defined in the Delphi type library:
type
TxProblemFilter = TOleEnum;
const
pfAll = $00000000;
pfResolved = $00000001;
pfUnresolved = $00000002;
pfAuditTrail = $00000003;
IIntegraNotesDMRDisp = dispinterface
[’{FD0CD999-AA79-487E-B559-182156D1D03A}’]
procedure DisplayProblemList(FilterType: TxProblemFilter); safecall;
The WinForms project can expose these properties so that it understands the above declaration.
This may be fine for ActiveX, but when Hydra creates the corresponding interface in WinForms, types such as “TxProblemFilter” are obviously not recognized and the constants are not imported.
How would I rewrite this so that Hydra would include the type and constant definitions in the generated interface? If it is not possible I could simply convert the parameters to known types (integer) and pass an integer value, but it would be nice to have clear definitions for readability. Would enum types work in this case, and if so, could you give an example of how it would look in Delphi so that Hydra would successfully convert it into .NET?