Hey there..
Recently I was looking into using the DL class directly for performing my dll calls; however, I am not fully sure on how to implement a 'switch' from my current Win32AI functions.
For example, lets say I have a dll called 'DekitaAwesomeDLL' and within it, a function named 'RandomFunction' which accepts a pointer, a long int and a regular int. This function also returns an int.
I could use Win32API like so...
function = Win32API.new('DekitasAwesomeDLL','RandomFunction','PLI','I') # Assumes 'pointer,longint,regint' are already defined. function.call(pointer,longint,regint)I am not sure on how to convert such a call into the DL class directly. I think* it would be something like this...
dll = DL::dlopen('DekitasAwesomeDLL') function = DL::CFunc.new(dll, DL::TYPE_INT, 'RandomFunction', :stdcall) # Assumes 'pointer,longint,regint' are already defined. function.call(pointer,longint,regint)But I am not sure on how the actual pointer, longint and regint should differ hen using DL compared to Win32API.
Anyone able to provide info on this ? 🙂
Recently I was looking into using the DL class directly for performing my dll calls; however, I am not fully sure on how to implement a 'switch' from my current Win32AI functions.
For example, lets say I have a dll called 'DekitaAwesomeDLL' and within it, a function named 'RandomFunction' which accepts a pointer, a long int and a regular int. This function also returns an int.
I could use Win32API like so...
function = Win32API.new('DekitasAwesomeDLL','RandomFunction','PLI','I') # Assumes 'pointer,longint,regint' are already defined. function.call(pointer,longint,regint)I am not sure on how to convert such a call into the DL class directly. I think* it would be something like this...
dll = DL::dlopen('DekitasAwesomeDLL') function = DL::CFunc.new(dll, DL::TYPE_INT, 'RandomFunction', :stdcall) # Assumes 'pointer,longint,regint' are already defined. function.call(pointer,longint,regint)But I am not sure on how the actual pointer, longint and regint should differ hen using DL compared to Win32API.
Anyone able to provide info on this ? 🙂