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


// funcapp.cpp : Defines the entry point for the console application. 
// start in 2011-01-13 ; 
#include "stdafx.h" 
#include "funcapp.h" 
//#include "Afxwin.h" // compatibility for c language, so it is not necessary; 
 
 
void FuncInition(void)  
{ 
	// user add the functions; 
	Add=(PAdd)GetProcAddress(HFInst,"Add"); 
	Minus=(PMinus)GetProcAddress(HFInst,"Minus"); 
	Div=(PDiv)GetProcAddress(HFInst,"Div"); 
	Multi=(PMulti)GetProcAddress(HFInst,"Multi"); 
	Mode=(PMode)GetProcAddress(HFInst,"Mode"); 
	GetVer=(PGetVer)GetProcAddress(HFInst,"GetVer"); 
} 
 
 
int _tmain(int argc, _TCHAR* argv[]) 
{ 
/******************************************** don't care *********************************************/ 
	if (!FuncLoadLibrary()) // judge the dll load status; 
	{ 
		return 0; // if dll load failed, the program will exit, and return the value 0; 
	} 
	FuncInition(); 
/******************************************** don't care *********************************************/ 
 
	// user test program; 
	char teststr[20]; 
	printf("add function 1+2 = %d\r\n",Add(1,2)); 
	printf("add function 1.1+2.3 = %d\r\n",Add(1.1,2.3)); 
	printf("add function 1-2 = %d\r\n",Minus(1,2)); 
	printf("add function 1/2 = %d\r\n",Div(1,2)); 
	printf("add function 1*2 = %d\r\n",Multi(1,2)); 
	printf("add function 1%2 = %d\r\n",Mode(1,2)); 
	GetVer(teststr); 
	printf("add function 1%2 = %s\r\n",teststr); 
 
 
 
	printf("hello func dll !\r\n"); 
	system("pause"); 
	return 0; 
}