www.pudn.com > funcdll.rar > funcdll.cpp, change:2011-02-14,size:1359b


// funcdll.cpp : Defines the entry point for the DLL application. 
// start the projects in 2011-01-13 ; 
 
#include "stdafx.h" 
#include "funcdll.h" 
#include "stdio.h" 
 
#ifdef _MANAGED 
#pragma managed(push, off) 
#endif 
 
BOOL APIENTRY DllMain( HMODULE 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; 
} 
 
#ifdef _MANAGED 
#pragma managed(pop) 
#endif 
 
// This is an example of an exported variable 
FUNCDLL_API int nfuncdll=0; 
 
// This is an example of an exported function. 
FUNCDLL_API int fnfuncdll(void) 
{ 
	return 42; 
} 
 
// This is the constructor of a class that has been exported. 
// see funcdll.h for the class definition 
Cfuncdll::Cfuncdll() 
{ 
	return; 
} 
 
 
FUNCDLL_API int Add(int var1,int var2) 
{ 
	return var1+var2; 
} 
 
FUNCDLL_API int Minus(int var1,int var2) 
{ 
	return var1-var2; 
} 
 
FUNCDLL_API int Div(int var1,int var2) 
{ 
	return var1/var2; 
} 
 
FUNCDLL_API int Multi(int var1,int var2) 
{ 
	return var1*var2; 
} 
 
FUNCDLL_API int Mode(int var1,int var2) 
{ 
	return var1%var2; 
} 
 
FUNCDLL_API void GetVer(char * str1) 
{ 
	sprintf(str1,"%s","QT-ST-HF-DLL_V1.0"); 
}