[PowerBuilder] Fonction DLL en dynamique
bonjour,
je cherche a executer une fonction d'une DLL de façon dynamique avec PB.
j'ai un p'tit bout de code qui le fait en C++, mais je ne trouve pas d'exemple equivalent avec PB :?
est-ce possible de faire l'equivalent sous PB ?
merci
Code:
1 2 3 4 5 6 7
| typedef int (WINAPI *DLL_Function) (LPSTR _szCDBFilename, LPSTR _szDirectory);
// Name off the function we want to call
#define FUNCTION_NAME "GetConverted"
// Name of the DLL to load
#define MODULE_NAME "Convert.dll" |
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| static char ModPath[255]="";
int Status;
DLL_Function Fn_Ptr;
HMODULE ModId;
strcat(ModPath, MODULE_NAME);
// Load the DLL
ModId = LoadLibrary(ModPath);
// Get the adr of the function to call
Fn_Ptr = (DLL_Function)GetProcAddress(ModId, FUNCTION_NAME); |