HOW DLL, HEADER AND LIBRARY

Hi, guys. can anyone help me about on how can i implement in my console application and use the DLL function.

I have the header file name sgs_api.h with the following functions.
sgs_API UINT APIENTRY sgsGetEntryPoints( sgs_ept **ppEPT );
sgs_API UINT APIENTRY sgsGetAPIVersion( void );
sgs_API UINT APIENTRY sgsGetDriverVersion( char * );
sgs_API void APIENTRY sgsDispDriverVersion( HWND, UINT, UINT );
sgs_API UINT APIENTRY sgsSetupScanner( SST * );
sgs_API UINT APIENTRY sgsCalibScanner( SST *, UINT );
sgs_API UINT APIENTRY sgsInquScanner( SST *, SFT *, UINT );
sgs_API UINT APIENTRY sgsTestScanner( SST *, UINT );

and i have the sgs_api.lib files, which i dont know how to use this file.
and i have the sgs_hlsC.DLL when i use the dependency walker i saw similar with this header. but they are in totally different name.

_sgsGetEntryPoints@4
_sgsGetAPIVersion@0
_sgsGetDriverVersion@4
_sgsDispDriverVersion@12
_sgsSetupScanner@4
_sgsCalibScanner@8
_sgsInquScanner@12
_sgsTestScanner@4

how can i connect this files in order for me to call those function in my console project.

You need to specify the name of the DLL file to the linker. The linker is respnsible for resolving the function calls in your code to the function entry points in the DLL library.

You don't specify what IDE/compiler/linker you're using, so i can't tell you how to do that.

The names in the DLL are different because C++ "mangles" the names to encode the argument types into the function name. This allows the linker to distinguish functions which have the same name, but different argument types.



Hi thank you for your reply. after that i follow this info, i get another warning.

and try to use something like this
typedef sgs_API UINT (APIENTRY *pGetAPIVersion)( void );

anyway i use Code Blocks and i'am new for this IDE for C++ developing
and it gives me error
C:\PSS Project\TestProgram\TestDLL\sgs_api.h|606|warning: 'dllimport' attribute ignored [-Wattributes]|

i cant identify this error.

can you lead me upto i load successfully the DLL. thanks in advance
Topic archived. No new replies allowed.