Defining a function that receives any struct (pointer to void?)
Hello people,
Basically, I'm trying to wrap the DatabaseReadBind function https://www.mql5.com/en/docs/database/databasereadbind
But I can't figure out a way of defining a function (actually, instance method) that accepts as void &something (as DatabaseReadBind does).
Without wrapping, works fine:
Wrapping in a method, breaks:
Errors:
Kinda unrelated but my intention is to wrap "error catching" code as on SQL errors the tester just say stuff like "database error, no such column: IND" with 0 hints on where to find it. Any help? What am I missing? Thanks, everybody!
You can't do that with struct in MQL.
Use template functions or classes.
Bummer,
thanks!
Hello people,
Basically, I'm trying to wrap the DatabaseReadBind function https://www.mql5.com/en/docs/database/databasereadbind
But I can't figure out a way of defining a function (actually, instance method) that accepts as void &something (as DatabaseReadBind does).
Without wrapping, works fine:
Wrapping in a method, breaks:
Errors:
Kinda unrelated but my intention is to wrap "error catching" code as on SQL errors the tester just say stuff like "database error, no such column: IND" with 0 hints on where to find it. Any help? What am I missing? Thanks, everybody!