was created using borland are there any changes that must be done on it before using it in VC++
Just occurred to me that probably you'll have to do some changes before using LIB.exe. Apparently the .DLL functions use __stdcall
calling convention, so you'll have to modify each function so that they'll conform to the MS's name decoration convention. In practice, every function is to be appended an '@', followed by the number of bytes taken by the arguments.
I.e. if you have a library function void __stdcall function(char *, char *, char *);
it would be function@12
in the .def file.
Furthermore, in your project which will include the generated .lib + its accompanying header,
1) use extern "C" {}
in the header file to wrap all the exported functions.
2) make sure that the exported functions are seen as __stdcall
, either use the /Gz switch or explicitly add the __stdcall
to each function prototype.
Note that LIB.exe will additionally prefix every function with an underscore. So if you'll look into the .LIB's exports by e.g. dumpbin.exe /EXPORTS LT360LIB.lib
you'll see something like _LT360LIB_CloseLink@0
(assuming LT360LIB_CloseLink does not arguments)
If you end up having mixed-up calling conventions, your program will crash at run-time.