正在加载图片...
#incl tring h typedef IString*("PfnCreate String)(const char * psz) void maine IStr HANDLE h=LoadLibrary(c: templmystringdll if(NULL =h)( Pfn Create String pfn ( Pfn Create String) GetProcAddress(h, "Create String") 建 if (pfn)( p=pfn( hello") if(p) nst char psz=p->Find( llo") 象 n=p->Length // Be careful about calling FreeLibrary创 建 对 象 #include "istring.h" typedef IString * (*PfnCreateString)(const char *psz); void main() { IString *p; HANDLE h = LoadLibrary("c:\\temp\mystring.dll"); if (NULL!=h) { PfnCreateString pfn = (PfnCreateString)GetProcAddress(h,"CreateString"); if (pfn) { p = pfn("Hello"); if (p) { const char*psz = p->Find("llo"); int n = p->Length(); } } // Be careful about calling FreeLibrary. } };
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有