Code:
#pragma comment(linker, "/export:SteamDllMain=SteamUI.SteamDllMain,@1")
or
Code:
#define S_API extern "C" __declspec( dllexport )
#define STEAM_CALL __cdecl
typedef int (STEAM_CALL *_SteamDllMain)(int a, int b);
_SteamDllMain oSteamDllMain;
S_API int STEAM_CALL SteamDllMain(int a, int b)
{
char szCurDir[MAX_PATH];
GetCurrentDirectory(MAX_PATH,szCurDir);
char szSteamPath[MAX_PATH];
strcpy_s(szSteamPath,szCurDir);
strcat_s(szSteamPath,"\\SteamUI.dll");
HMODULE hLib;
int nRetVal;
hLib = LoadLibrary(szSteamPath);
if(hLib)
{
oSteamDllMain = (_SteamDllMain)GetProcAddress(hLib,"SteamDllMain");
nRetVal = oSteamDllMain(a, b);
FreeLibrary(hLib);
}
return nRetVal;
}