Well what I'm actually looking for is for my DLL/library to determine if the application it's included in has the function in it. Basically the reason for this is because the user will then have the choice of creating certain functions to handle certain situations in the way they want to handle them. Or they could leave my DLL/library to handle it in the default manner in which it's normally done. Thats why I want to be able to determine if a function exists or not. In the documentation of the DLL/library I will be giving lots of information as well as listings of all functions that they would have to create in order to handle the different situations in the manner in which they want to. So whoever uses this DLL/library will know which functions to create if they want to, but it will be their choice.
I guess I could use the method of using the myGetProcAddress() function mentioned above, but I was hoping to be able to do something more along the lines of just:
in the .h for my DLL/Library
Code:
extern int SituationA(char *someChar);
and then in the code for the DLL/Library
Code:
if SituationA exists
SituationA(someChar);
else
// default
This way the user doesn't have to do anything extra in order to handle the situation. All they have to do is create a function with the necessary code inside of what they want done for that particular situation. Any ideas on how to do that?
Another method I was contemplating is still placing the "externs" of all the functions into the .h and then having the user pass some sort of value to a function I can create to let me know which ones the user would be handling... such as:
Code:
err = UHandle(UH_SITUATIONA | UH_SITUATIONZ...);
if( err == 0 )
MessageBox(0, "Everything is okay to handle those situations...", "Return Value", MB_OK);
else
MessageBox(0, "Guess the default is going to be used...", "Return Value", MB_OK);
Now I guess no one would want that sort of error handling for theirs, but I just put that in to show how they would know if they could handle those situations or not.
[Edit]
Well I guess I could also use something like what was mentioned above (pointers to the function... declare them as extern int (*SituationA)(); and then point them to the defaults, then if the user wants to handle them, allow them to simply redirect which functions they point to). Thats another way I guess.
[/Edit]
Let me know what you think,
Tyouk