static My1 *(*pfn)()=0;  
*(FARPROC*) &pfn=GetProcAddress(hdll,"CreateMy2");这2行代码这么多*迷糊了 我主要想知道为什么这么做 转来转去的 部分代码
/////部分dll代码 实现代码 我就不用贴了吗
//My(virtual).hclass My1
{
public:
virtual void add(int x,int y)=0;
virtual int getint()=0;
virtual void Delete()=0;};//My2.h#include"My(virtual).h"
class My2 :public My1
{
int Iindex;
public:
My2();
void add(int x,int y);
int getint();
void Delete();
};//CreatrMy2.h#include"My2.h"
extern "C" __declspec(dllexport) My1 *CreateMy2();#include"CreatrMy2.h"//CreatrMy2.CPP
My1 * CreateMy2()
{
return new My2;
}
////////////调用代码///////////// HMODULE hdll;
hdll=LoadLibrary("dll1.dll");
if(hdll==NULL) 
{
AfxMessageBox("dll加载失败");
return;
}
///////这2行代码这么多*迷糊了谁能解释下谢谢///////////
static My1 *(*pfn)()=0;   ////
*(FARPROC*) &pfn=GetProcAddress(hdll,"CreateMy2");////
/////////////////////////////////////////////////////
My1 *mm=pfn();
mm->add(11,11);
int a=mm->getint();
CString str;
str.Format("%d",a);
AfxMessageBox(str);
mm->Delete();
FreeLibrary(hdll);