c_Continuation *c_Continuation::Clone(ObjectData* obj) { auto thiz = static_cast<c_Continuation*>(obj); auto fp = thiz->actRec(); c_Continuation* cont = static_cast<c_Continuation*>(fp->getThisOrClass() ? CreateMeth(fp->func(), fp->getThisOrClass(), thiz->m_offset) : CreateFunc(fp->func(), thiz->m_offset)); cont->copyContinuationVars(fp); cont->o_subclassData.u16 = thiz->o_subclassData.u16; cont->m_index = thiz->m_index; cellSet(thiz->m_key, cont->m_key); cellSet(thiz->m_value, cont->m_value); return cont; }
//加载模块 bool CServiceParameter::LoadGameServiceModule(LPCTSTR pszModuleName) { //效验状态 ASSERT(m_hDllInstance==NULL); ASSERT(m_pIGameServiceManager==NULL); //加载模块 m_hDllInstance=AfxLoadLibrary(pszModuleName); if (m_hDllInstance==NULL) { FreeGameServiceModule(); return false; } //查找函数 ModuleCreateProc * CreateFunc=(ModuleCreateProc *)GetProcAddress(m_hDllInstance,TEXT("CreateGameServiceManager")); if (CreateFunc==NULL) { FreeGameServiceModule(); return false; } //获取接口 m_pIGameServiceManager=(IGameServiceManager *)CreateFunc(IID_IGameServiceManager,VER_IGameServiceManager); if (m_pIGameServiceManager==NULL) { FreeGameServiceModule(); return false; } //获取属性 m_pIGameServiceManager->GetGameServiceAttrib(m_GameServiceAttrib); lstrcpyn(m_OptionParameter.szModuleName,m_GameServiceAttrib.szServerModuleName,CountArray(m_OptionParameter.szModuleName)); return true; }