Lucas Ferraz
23rd October 2013, 21:50
Hello guys!
So, I'm stuck wih a situation here.
I'm in a DLL, an I need to call a function which name is in a table.
So I read the table, get the name of the function, and need to call it, inside the DLL itself.
Lets say I read the table tcspd060, get the field tcspd060.func.o, which contains the name of a local function inside the DLL itself, and have to run that function.
My real scenario is much bigger and acually makes sense.
Is that possible?
Lucas Ferraz
23rd October 2013, 22:02
Basically what I need is a function like on.main.table() that I can run in a DLL, called from a update session.
vahdani
23rd October 2013, 22:55
Hi Lucas,
yes, this can be done. Take a look at exec_dll_function() (http://http://www.baanboard.com/programmers_manual_baanerp_help_functions_dll_exec_dll_function) or load_dll() (http://http://www.baanboard.com/programmers_manual_baanerp_help_functions_dll_load_dll), get_function() (http://http://www.baanboard.com/programmers_manual_baanerp_help_functions_dll_get_function), and exec_function() (http://http://www.baanboard.com/programmers_manual_baanerp_help_functions_dll_exec_function) combination.
Lucas Ferraz
25th October 2013, 00:50
Hello!
I've tried to use those function but couldnt for one simple reason, I need to call functions of a DLL from the DLL itself.
So my update program calls the main process function of the DLL, and this function calls many others dinamically. That didnt work because the DLL and its functions were already loaded, and it isnt possible to get the function IDs.
So I altered the update program to load the DLL dinamically and get the functions IDs before the first convencional call of the DLL. This way, saving the funcion IDs, I was able to use exec_function from inside the DLL.
Thanks!
JaapJD
25th October 2013, 09:33
Probably in your first try you didn't define your functions as external ones.