5#include <interface/obj-ref-i.h>
6#include <string/tstring.h>
13 typedef BOOL (*funSCreateInstance)(IObjRef **);
17 ,m_funCreateInst(NULL)
23 if(m_hMod) FreeLibrary(m_hMod);
26 BOOL CreateInstance(LPCTSTR pszDllPath,IObjRef **ppObj,LPCSTR pszFnName =
"SCreateInstance")
28 SStringT strPath(pszDllPath);
36 m_hMod=LoadLibrary(strPath);
39 const char * err = dlerror();
40 printf(
"load so failed, err=%s\n", err);
44 m_funCreateInst=(funSCreateInstance)GetProcAddress(m_hMod,pszFnName);
50 _tcscpy(m_szDllPath,strPath);
52 return m_funCreateInst(ppObj);
60 funSCreateInstance m_funCreateInst;
61 TCHAR m_szDllPath[MAX_PATH];