????????????
????????????????QQ????????????????????????Щ??????????????????????????????????LoadRunner????????????????/?????????????????????????????????????????
???????β?????????????????????????????????????????????DEC?????????LoadRunner?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????ó???????????????????????????????????????????????????????????????????????????????????????????????
??????????????API?????LoadRunner???????????????????????????м????????????????????е????????μ??????????????ü????????????????????????????е????????????????????????????DLL????Ч???????????????????????????DLL???????????????????DLL???д??????LoadRunner?е??ó??????Ч??????????????????????????????????????????
??????????????д
??????Visual C++6.0?????????£???FileNewProject??????????Win32 Dynamic-Link Library??????????DLL?????
????1??Win32 Dynamic-Link Library???????Non-MFC DLL????????
????????DLL???????????????????????C??д????ó?????????????????WINMAIN???????????Non-MFC DLL??DllMain????????????????????????д?????DLL??????????????????????????????????????????????????????????ó????DLL????????????????????????????????????????????????????????????????????DLL?????.CPP????ж?DllMain()?????????????????д??
????
????BOOL APIENTRY DllMain(HANDLE hModule??DWORD ul_reason_for_call??LPVOID lpReserved)
????{
????switch(ul_reason_for_call)
????{
????case DLL_PROCESS_ATTACH:
????break;
????case DLL_THREAD_ATTACH:
????break;
????case DLL_THREAD_DETACH:
????break;
????case DLL_PROCESS_DETACH:
????break;
????default:
????break;
????}
????return TRUE;
????}
?????????У?hMoudle??????????????????????????????????(?????????????_DGROUP?ε????????)??ul_reason_for_call?????????????????????????????????????ж?????????????????????????????????????????????????????????е????????DLL_PROCESS_ATTACH:????????á?DLL_THREAD_ATTACH:???????á?DLL_PROCESS_DETACH:?????????DLL_THREAD_DETACH:????????lpReserved??????????????????DLL???????????д?????2????????????????????DLL?????м??????????????????????????
??????????????DLL???????????????????????ó??????DLL?е??????????????????Щ?????????????ó?????á????????Щ??????????????????????庯??????????????_declspec(dllexport)???????????????????DLL?????????鶨?????.Def???????????????????????????????????????DEF????????????????????????????????????????????DLL?????
???????????????????_declspec(dllexport)????MyDll.dll???????????????????????????????????????????????С??????MyDll.h??MyDLL.cpp????з???????????????????
????//MyDLL.h
????extern"C"_declspec(dllexport)int desinit(int mode);
????extern"C"_declspec(dllexport)void desdone(void);
????extern"C"_declspec(dllexport)void des_setkey(char*subkey??char*key);
????extern"C"_declspec(dllexport)void endes(char*block??char*subkey);
????extern"C"_declspec(dllexport)void dedes(char*block??char*subkey);
????//MyDll.cpp
????#include"MyDll.h"
????//?????????????С?????????????????????
????int desinit(int a??int b)
????{
????if(a>=b)return a;
????else
????return b;
????}
????int desdone(int a??int b)
????{
????if(a>=b)return b;
????else
????return a;
????}