Backward compatibility in dll

I have three dlls.

  • a.dll - released many years ago
  • b.dll - released not so many years
  • c.dll - soon released

Each of them contains the same function - unfortunately, with different parameters. so i have the following methods

aMethod(param1)
aMethod(param1, param2)
aMethod(param1, param2, param3)

My task is to create a new dll (or a new dll) that is backward compatible. But, as far as I learned from Google, there is no way to overload methods in a dll.

Does anyone have any feedback on how I can solve this problem elegantly?

+3
source share
3 answers

DLL. , DLL, - Windows, Delphi. , Delphi , , , . , -- DLL, , .

Delphi , , . , .

, DLL, , a.dll. , .

, DLL, DLL, exe , ( ).

, dll (a, b, c), - dll + . , DLL exes, dll a, b c? . , DLL . , .

+1

- - - Delphi, #:

aMethod( int version, object args)

or in C:

aMethod (int version, void** args)

Then according to the version you can use casting. Note that args can also be a collection object.

NTN.

0
source

Source: https://habr.com/ru/post/1747986/


All Articles