Try another way: call the function from the dll, getting a pointer with GetProcAddress;
Example:
C ++ dll call
Update:
VLC media player loads as version 7zip;
I choose the path using GetProcAddress:
#include <windows.h>
#include <iostream>
int main()
{
SetCurrentDirectory("C:/Program Files/VideoLAN/VLC");
HINSTANCE hGetProcIDDLL = LoadLibrary("libvlc.dll");
FARPROC lpfnGetProcessID = GetProcAddress(HMODULE(hGetProcIDDLL),"libvlc_get_version");
if(lpfnGetProcessID == 0)
{
std::cout << "GetProcAddress failed";
return 1;
}
typedef const char * (__stdcall * pICFUNC)(void);
pICFUNC MyFunction = pICFUNC(lpfnGetProcessID);
std::cout << MyFunction() << std::endl;
return 0;
}
, Unicode :
→ → → ;
! !;)
2:
lib, cmd:
Microsoft Windows XP [ 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.
C:\Program Files\Microsoft Visual Studio 9.0\VC\bin > vcvars32.bat
C:\Program Files\Microsoft Visual Studio 9.0\VC\bin > "C:\Program \Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat" Microsoft Visual Studio 2008 x86 .
C:\Program Files\Microsoft Visual Studio 9.0\VC\bin > dumpbin.exe/exports "D:\ \VLC\VLC-1.1.4-win32\VLC-1.1.4\libvlc.dll"
"C:\Documents and Settings\Eugene\ \Visual Studio 2008\Projects\VLCApp\VLCApp\libvlc.def"
C:\Program Files\Microsoft Visual Studio 9.0\VC\bin > lib /def: "C:\Documents and S ettings\Eugene\ \ 2008\Projects\VLCApp\VLCApp\libvlc.def" /out: "C:\Documents and \Eugene\ \ 2008\ s\VLCApp\VLCApp\libvlc.lib" /: x86 Microsoft (R) 9.00.30729.01 (C) Microsoft. .
C:\Documents and \Eugene\ \ 2008\Projects\VLCApp\VLCApp\libvlc.lib C:\Documents and \Euge ne\ \ 2008\Projects\VLCApp\VLCApp\libvlc.exp
C:\Program Files\Microsoft Visual Studio 9.0\VC\bin >