Library Load failed

lbiry

Active Member
Hello everybody,
I begin to work with external C business function and your posts help me a lot but I still have a problem.
I want to use the GetPOValueAndText BSFN (B9200030) in an external C program.
I have modified the code alignment to "1", the compilation mode to "__stdcall", add jdekrnl.lib and jdel.lib in the library path and add the compilator instruction (#define KERNEL /D "KERNEL") but I still receive a "Business Function Library Failed - _GetPOValueAndText@12" each time I call the API with jdeCallObject.
Have I missed something ?
Thanks for your help.

Here is my code :
int __cdecl main()
{
HENV hEnv = NULL;
HUSER hUser = NULL;
DSD9200030 Ds9200030;
MATH_NUMERIC mathnum = {0};
LPBHVRCOM lpBhvrCom;
LPCG_BHVR lpVoid;
ERROR_EVENT_KEY EventKeyLocal;

JDB_InitEnvOvr(&hEnv, "DV7333", "JDE", "JDEPWD");
JDB_InitUser(hEnv, &hUser, (char*) NULL, JDEDB_COMMIT_AUTO);

jdeCreateBusinessFunctionParms(hUser, &lpBhvrCom, (LPVOID*) &lpVoid);
lpVoid->lpHdr = jdeErrorInitializeEx();
lpVoid->lpHdr->nCurDisplayed = -1;
lpVoid->lpErrorEventKey = (LPERROR_EVENT_KEY)jdeAlloc(COMMON_POOL, sizeof(ERROR_EVENT_KEY), MEM_ZEROINIT | MEM_FIXED);
lpBhvrCom->lpObj->lpFormHdr = lpVoid->lpHdr;
EventKeyLocal.hwndCtrl = NULL;
EventKeyLocal.iGridCol = 0;
EventKeyLocal.iGridRow = 0;
EventKeyLocal.wEvent = 1;
lpBhvrCom->lpEventKey = (LPVOID)&EventKeyLocal;

ParseNumericString(&mathnum, "2");

memset((void*)(&Ds9200030), (int)('\0'), sizeof(Ds9200030));
strcpy(Ds9200030.szNameObject,"P0911");
strcpy(Ds9200030.szVersion, "ZJDE0001");
Ds9200030.cCacheCode = '1';
Ds9200030.hCursor = (ID)0;
Ds9200030.mnNumberKeys = mathnum;
strcpy(Ds9200030.szLanguagePreference, "F");

jdeCallObject("GetPOValueAndText", (LPFNBHVR)NULL, lpBhvrCom, lpVoid, &Ds9200030, (CALLMAP*)NULL, (int)0, (char*)NULL, (char*)NULL, 0);

Ds9200030.cCacheCode = '6';
jdeCallObject("GetPOValueAndText", (LPFNBHVR)NULL, lpBhvrCom, lpVoid, &Ds9200030, (CALLMAP*)NULL, (int)0, (char*)NULL, (char*)NULL, 0);

printf("%s\n", Ds9200030.szDataStructureTemplateName);

jdeFreeBusinessFunctionParms(lpBhvrCom,lpVoid);
lpBhvrCom = NULL;
lpVoid = NULL;

JDB_FreeUser(hUser);
hUser = NULL;
JDB_FreeEnv(hEnv);
hEnv = NULL;
return 0;
}
 
in wich cum of E1 ?
did you set all path (include, lib, .. ) to Visual C ?
 
Back
Top