I know I can use GetProcAddress to get a pointer to a function in a dll, and I can use CodePtr to get the address to a function in my exe. But I have a unique situation that I can not solve.
What I am trying to do (and maybe can't be done) is be able to use a string like "CallByName" to call my function at runtime, that is not known at compile time.
I have tried comparing pointers to match the function as a string to the function itself, but not being the same, the pointers are not the same.
Googling things I see hints of the PE for a file (compiled as DLL or as EXE) are the same, so I hope that is the answer, but overall, has anyone done something like this???? or know how to do it?? or something I have not thought of yet???
- GetProcAddress - Although uses a string for a function, only seems to work with a dll?
- CodePtr - Although works for Functions in my Exe, does not allow for a string to be used for the name of the function?
- CallByName - Although seen in VB, and found in Jose Roca's forum, comparing the 2 I realize only works on COM objects
What I am trying to do (and maybe can't be done) is be able to use a string like "CallByName" to call my function at runtime, that is not known at compile time.
I have tried comparing pointers to match the function as a string to the function itself, but not being the same, the pointers are not the same.
Googling things I see hints of the PE for a file (compiled as DLL or as EXE) are the same, so I hope that is the answer, but overall, has anyone done something like this???? or know how to do it?? or something I have not thought of yet???

Comment