I need to call an external dll. Here are the basic instructions
that came with the external dll:
Code:
BIOWDLL.DLL Information
-------------------------------------
__declspec ( dllexport )int WINAPI GetSrcBIOWIN (PSTR cSmilePass,
PSTR cChemical, PSTR EstLin, PSTR EstNon, PSTR EstUlt, PSTR EstPrim,
PSTR UltTime, PSTR PrimTime, PSTR EstMitiLin, PSTR EstMitiNon,
PSTR DetailResults, PSTR numLines, PSTR ErrorMess)
Arguments with the same names as the KOWDLL.DLL are exactly the same.
This function returns: 0 for no errors
-1 for if a SMILES error occurs
NOTE ... this function receives three variables from the calling
function:
(1) cSmilePass - the SMILES notation
(2) cChemical - the user chemical name or identifier
Other argument variables:
(3) EstLin - estimated Linear Model biodegradation probability
(probability of biodegrading fast or not)
I'm trying to create a function that calls a function from biowwin.dll. My program passes the cSmilesPass parameter to the function, in this case it passes"C[N+]C(C)(C)".Here's my code:
Code:
int CallBIOWDLL(void)
{
/* get handle to dll */
HINSTANCE hGetProcIDDLL = LoadLibrary("C:\WINDOWS\system32\BIOWDLL.dll");
/* get pointer to the function in the dll*/
FARPROC lpfnGetProcessID = GetProcAddress(HMODULE(hGetProcIDDLL), "GetSrcBIOWIN");
/* Define the Function in the DLL for reuse. This is just prototyping
the dll's function. A mock of it. Use "stdcall" for maximum compatibility.
*/
typedef int (__stdcall * pICFUNC)(char*);
pICFUNC MyFunction;
MyFunction = pICFUNC(lpfnGetProcessID);
/* The actual call to the function contained in the dll */
int intMyReturnVal = MyFunction("C[N+]C(C)(C)");
/* Release the Dll */
FreeLibrary(hGetProcIDDLL);
/* The return val from the dll */
return intMyReturnVal;
}
I'm using Visual C++ 4.0. When I try to compile, I get the following warnings and errors:
Code:
Compiling...
request.cpp
C:\MSDEV\Projects\cfx_biowwin\request.cpp(14) : warning C4129: 'W' : unrecognized character escape sequence
C:\MSDEV\Projects\cfx_biowwin\request.cpp(14) : warning C4129: 's' : unrecognized character escape sequence
C:\MSDEV\Projects\cfx_biowwin\request.cpp(14) : warning C4129: 'B' : unrecognized character escape sequence
Linking...
cfx_biowwin.dll - 0 error(s), 3 warning(s)
I'm not sure about the unrecognized character escape sequence warnings. Any insight would be greatly appreciated.