// This class is exported from the DecodeString.dll
class DECODESTRING_API CDecodeString {
public:
CDecodeString(void);
// TODO: add your methods here.
};
extern "C" DECODESTRING_API int nDecodeString;
DECODESTRING_API int fnDecodeString(void);
-----------------------------------------------------------------------
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
// This is an example of an exported variable
DECODESTRING_API int nDecodeString=0;
// This is an example of an exported function.
DECODESTRING_API int fnDecodeString(void)
{
return 42;
}
//Max function
DECODESTRING_API int Max(int a, int b)
{
if(a>=b)return a;
else
return b;
}
//Min function
DECODESTRING_API int Min(int a, int b)
{
if(a>=b)return b;
else
return a;
}
// This is the constructor of a class that has been exported.
// see DecodeString.h for the class definition
CDecodeString::CDecodeString()
{
return;
}
/////////////在action中调用的代码为:
lr_load_dll(str);
c=fnDecodeString();-------Error -- Unresolved symbol : fnDecodeString.