用函数指针吧。
HINSTANCE hDll1 = NULL;
HINSTANCE hDll2 = NULL;
int (WINAPI * pIn1)(int) = NULL;
int (WINAPI * pIn2)(int) = NULL;
hDll1 = LoadLibrary("d:\\dll1\\dll1.dll");
if(NULL == hDll1)
return;
hDll2 = LoadLibrary("d:\\dll2\\dll2.dll");
if(NULL == hDll2)
return;
pIn1 = (int (WINAPI *)(int))GetProcAddress(hDll1,"in1");
ASSERT(pIn1);
pIn2 = (int (WINAPI *)(int))GetProcAddress(hDll2,"in2");
ASSERT(pIn2);
//如果要实现in2()的值传给in1(),可以如下写:
int nVal = 3;
int nRtn = pIn1(pIn2(nVal));
//out1的值out2(),没懂楼主什么意思。
FreeLibrary(hDll1);
FreeLibrary(hDll2);
[
本帖最后由 眼底星空 于 2012-9-11 11:08 编辑 ]