/* DLL1.C, This DLL is for use with the MAIN1 example. */ /* Please refer to the MK1_FC.BAT file for instructions on */ /* building this example */ /* This example demonstrates 'simple' interfaces between */ /* DLL and MAIN, using intrinsic data types */ #include #define DLL_PROCESS_DETACH 0 #define DLL_PROCESS_ATTACH 1 #if defined (BCPP) int __stdcall _export DLL1(float *a,float *a1,int *i,int *i1,int *l, int *l1); int __stdcall _export DLL1(float *a,float *a1,int *i,int *i1,int *l, int *l1) #else _declspec(dllexport) int _stdcall DLL1(float *a,float *a1,int *i,int *i1,int *l, int *l1); _declspec(dllexport) int _stdcall DLL1(float *a,float *a1,int *i,int *i1,int *l, int *l1) #endif { /* Note that without VAL(), LF95 passes args by address */ int ido; *a = 1.23; *i = 9876; *l = 1; for (ido = 0; ido < 10; ido++) { /* Note here that LF95 arrays start at subscript 1 */ a1[ido] = (ido + 1) * 2 - 1; i1[ido] = (ido + 1) * 2; l1[ido] = ((ido & 1) == 0); /*odd indices TRUE, evens, FALSE*/ } return (9999); } unsigned long __stdcall DllEntryPoint(void *hDll, unsigned long Reason, void *Reserved) { if (Reason == DLL_PROCESS_ATTACH) { /*perform DLL initialization tasks here*/ } return (1); }