📄 com.c
字号:
/****************************************************************************** com.c : our implementation of COM* REALmagic Quasar Hardware Library* Created by Michael Ignaszewski* Copyright Sigma Designs Inc* Sigma Designs Proprietary and confidential* Created on 8/27/99* Description:*****************************************************************************/#include "pch.h"#include "template.h"// General Module Definitionsint g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);//called by COM to get the class factory object for a given classHRESULT ModCreateInstance(DWORD dwInstance, QIID* rclsid, QIID* riid, LPVOID * ppv){ int i = 0; // traverse the array of templates looking for one with this // class id for (i = 0; i < g_cTemplates; i++) { CSDFactoryTemplate * pT = &g_Templates[i]; if (pT->m_QIID == (QIID*)rclsid) { // found a template - make a class factory based on this // template if (pT->m_lpfnNew != NULL) pT->m_lpfnNew (ppv, dwInstance); else return CLASS_E_CLASSNOTAVAILABLE; if (*ppv == NULL) { return E_OUTOFMEMORY; } return NOERROR; } } return CLASS_E_CLASSNOTAVAILABLE;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -