代码如下:
 void main()
{
HINSTANCE hdll;
hdll=LoadLibrary("..\\rout1015_1.dll");
typedef void (*MyCalculate)(void);
typedef int (*MyGetbuf)(char *);

MyCalculate calfunc1;
MyGetbuf calfunc2;
if(hdll!=NULL)
{
calfunc1=(MyCalculate)GetProcAddress(hdll,"RoutSocketInit");
calfunc2=(MyGetbuf)GetProcAddress(hdll,"Getbuf");
}
else
{
//AfxMessageBox("无法加载DLL");
return;
}
int i=100;
int j=0;
while (i--)
{
char buffer[20];
    RandStr(buffer);
j = Getbuf(buffer);      //DLL函数

Sleep(1000);
if(j==-1)
{
break;
}
}
RoutSocketInit();            //DLL函数
FreeLibrary(hdll);
}