| Mis objetivos en C no son programar, sino montar código y compilarlo. Esa es la idea. Mi primer código a compilar es : Logging In The following example uses C++ to access the GM5S32.DLL functions The DLL is dynamically loaded, and its function addresses are retrieved using the GetProcAddress API. // prototypes typedef int (*fnGMW_LoadBDE) ( char *szSysDir, char *szGoldDir, char *szCommonDir, char *szUser ); typedef int (*fnGMW_UnloadBDE) (); void GM5S32_DLL_Test() { // load the GM5S32.DLL HMODULE hLib = LoadLibrary("GM5S32.DLL"); if( hLib ) { // get proc addresses of GM5S32 functions fnGMW_LoadBDE GMW_LoadBDE = (fnGMW_LoadBDE) GetProcAddress( (HINSTANCE) hLib,"GMW_LoadBDE"); fnGMW_UnloadBDE GMW_UnloadBDE = (fnGMW_UnloadBDE) 158 Integrating with GoldMine 5.0 GetProcAddress((HINSTANCE) hLib,"GMW_UnloadBDE"); // initilize the BDE GMW_LoadBDE( "d:\\gm4", "d:\\gm4", "d:\\gm4\\demo", szUser, szPass ); // do whatever.............. // shut down BDE GMW_UnloadBDE(); // unload the DLL FreeLibrary(hLib); } return; } Dicho código corresponde al manual de Integrating with Goldmine (yo tengo la versrión antigua Goldmine 5.5 al cual el manual se refiere) En mi caso, por la ubicación de las carpetas del programa y del BDE (Borland Database Engine) es script creo que me quedaría así : // prototypes typedef int (*fnGMW_LoadBDE) ( char *szSysDir, char *szGoldDir, char *szCommonDir, char *szUser ); typedef int (*fnGMW_UnloadBDE) (); void GM5S32_DLL_Test() { // load the GM5S32.DLL HMODULE hLib = LoadLibrary("GM5S32.DLL"); if( hLib ) { // get proc addresses of GM5S32 functions fnGMW_LoadBDE GMW_LoadBDE = (fnGMW_LoadBDE) GetProcAddress( (HINSTANCE) hLib,"GMW_LoadBDE"); fnGMW_UnloadBDE GMW_UnloadBDE = (fnGMW_UnloadBDE) 158 Integrating with GoldMine 5.0 GetProcAddress((HINSTANCE) hLib,"GMW_UnloadBDE"); // initilize the BDE GMW_LoadBDE( "y:\\goldmineprg", "y:\\goldmineprg", "y:\\goldmineprg\\demo", szUser, szPass ); // do whatever.............. // shut down BDE GMW_UnloadBDE(); // unload the DLL FreeLibrary(hLib); } return; } szUser sería JOSE y szPass con valor vacío o en blanco. Alguna orientación antes de meter el código en el compilador ? Gracias |




News