获取动态库libmold.dll的路径
void TcharToChar(const TCHAR* tchar, char* _char)
{int iLength;
#if UNICODE//获取字节长度 iLength = WideCharToMultiByte(CP_ACP, 0, tchar, -1, NULL, 0, NULL, NULL);//将tchar值赋给_char WideCharToMultiByte(CP_ACP, 0, tchar, -1, _char, iLength, NULL, NULL);
#elsestrcpy(_char, tchar);#endif
}
char* GetNXPath()
{//找到主窗口程序路径TCHAR nxname[MAX_PATH];GetModuleFileName(NULL, nxname, MAX_PATH);char msg[256];TcharToChar(nxname, msg);char NXpath[256], NXname[256];uc4576(msg, -1, NXpath, NXname);return NXpath;
}
加载动态库libmold.dll调用内部函数 MW_face_ask_area
double AskFaceArea(tag_t face_tag)
{char LibPath[256];strcpy(LibPath, GetNXPath());strcat(LibPath, "\\libmold.dll");typedef double(*load_ufusr_f_p_t)(tag_t);load_ufusr_f_p_t MW_face_ask_area= NULL;int eror = UF_load_library(LibPath, "?MW_face_ask_area@@YANI@Z", (UF_load_f_p_t*)&MW_face_ask_area);if (MW_face_ask_area!= NULL){return MW_face_ask_area(face_tag);}else{return 0;}}