same function, two different parameter sets for external dll?
Posted on 2006-10-19
We have a dll written in C++ that is used in several external applications. The external functions work fine, but there is a serious compatibility issue and I'm trying to figure out a way around it. Here's the current situation (please ignore pseudo-syntax because it's not the issue here):
extern myFunction (parameter1, parameter2, parameter3)
extern myFunction (parameter2, parameter2, parameter2a, parameter3)
Parameters 1, 2, and 3 are identical, but Version B has an extra parameter stuck in the middle. Is there any way I can come up with a Version C that supports both versions of myFunction? In other words, can I have two function definitions for the same function, and depending on how many parameters there are, decide which definition I should use??? Changing the names of one of the functions is not an option. Right now we're just supporting both versions of the dll but that is becoming next to impossible due to the number of applications that are using this dll.