• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CLSIDFromProgID函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中CLSIDFromProgID函数的典型用法代码示例。如果您正苦于以下问题:C++ CLSIDFromProgID函数的具体用法?C++ CLSIDFromProgID怎么用?C++ CLSIDFromProgID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了CLSIDFromProgID函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: lock

//------------------------------------------------------------------*
STDMETHODIMP
   CCustomConnect::CreateControlManagement(/*[in, string]*/ BSTR sInit, /*[out]*/ IUnknown **ppControlMgt)
{
    USES_CONVERSION;
    CSingleLock lock(&cs, TRUE);
    if (ppControlMgt == NULL)
        return E_POINTER;
    CString strInit = StripCommParam(sInit);
    if (!CheckInitString(strInit))
        return E_INVALIDARG;
    CLSID guid;
    TCHAR szProgID[256];
    lstrcpy(szProgID, g_ProgID_ControlMgt);
    lstrcat(szProgID, strInit);
    LPCWSTR lpwstrProgID = T2W(szProgID);
    HRESULT hr = CLSIDFromProgID(lpwstrProgID, &guid);
    if (FAILED(hr)) {
        hr = _Module.RegisterServerInstance(strInit);
        hr = CLSIDFromProgID(lpwstrProgID, &guid);
        for(int i=0; FAILED(hr) && i<100; i++) { // W2K: SP2-HACK
            Sleep(100);
            hr = CLSIDFromProgID(lpwstrProgID, &guid);
        }
    }
    if (FAILED(hr))
        return hr;

    //try to avoid second instance...
    CComPtr<IUnknown> pDummy;
    hr = CreateVarSession(sInit, &pDummy);
    if (FAILED(hr))
        return hr;

    return CoCreateInstance(guid, NULL, CLSCTX_ALL, IID_IUnknown, (void**)ppControlMgt);
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:36,代码来源:CustomConnect.cpp


示例2: switch

void 
Foobar::EnableDisable()
{
	static BOOL old = FALSE;
	if(m_enabled == old) return;

	switch(old){				//stop ...
		case 0:						break;
		case 1:	COM_Stop();			break;		//COM
		case 2:	m_needPoll = FALSE;	break;		//MLT
	}
	switch(m_enabled){			//start ...
		case 0:	{
			if(loaded)
				NotifyInfoChanged();
		}		break;
		case 1:	{
			CLSID clsid;
			if(	(SUCCEEDED(CLSIDFromProgID(L"Foobar2000.ApplicationHelper.0.7", &clsid))) &&
				(COM_Start()) ) break;	//COM is full install  (host and server)
			else
			if(	(SUCCEEDED(CLSIDFromProgID(L"Foobar2000.Application0.7", &clsid))) ) {
				m_needPoll = COM_ConnectServer() ? FALSE : TRUE;
				break;					//COM is install  (only server)
			}
		}
		//fall through (no com)
		case 2:	{
			m_enabled  = 2;
			m_needPoll = FALSE;
			//MLT_Start();
			}	break;		//MLT
	}
	old = m_enabled;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:35,代码来源:foobar.cpp


示例3: wmain

int wmain(int argc, wchar_t *argv[])
{
	if (argc != 2)
	{
		std::wcout << L"usage:" << std::endl
               << L"  LookupProgID.exe <ProgID>" << std::endl;
		return 0;
	}

	HRESULT hr;
	hr = CoInitialize(NULL);
	if (FAILED(hr))
	{
		std::wcout << L"CoInitialize failed" << std::endl;
		return 1;
	}

	CLSID clsid;
	hr = CLSIDFromProgID(argv[1], &clsid);
	if (SUCCEEDED(hr))
	{
		LPOLESTR s;
		hr = StringFromCLSID(clsid, &s);
		if (SUCCEEDED(hr))
		{
			std::wcout << "CLSID: " << s  << std::endl;
			CoTaskMemFree(s);
		}
	}

	CoUninitialize();
	return 0;
}
开发者ID:JianchengZh,项目名称:kasicass,代码行数:33,代码来源:LookupProgID.cpp


示例4: Init

HRESULT _IFUNC BOleInProcHandler::Init(PIBDataProvider pDP,
  PIBPart pP, LPCOLESTR szProgId, BOOL fHatchWnd)
{
  HRESULT hr;
  // Initialize back pointers
  //
  pProvider = pDP;
  pPart = pP;

  CLSID cid;
  if (SUCCEEDED(hr = CLSIDFromProgID(szProgId, &cid))) {

    // create the default handler, which will launch the exe server
    //
    OleCreateEmbeddingHelper(cid, AsPIUnknown(pObjOuter),
      EMBDHLP_INPROC_HANDLER | EMBDHLP_DELAYCREATE, NULL, IID_IUnknown,
      &(LPVOID)pDefHandler);

    // initialize default IPS
    //
    hr = pDefHandler->QueryInterface(IID_IBSite, &(LPVOID)pDefSite);
    if (SUCCEEDED(hr)) {
      pDefSite->Release();     // prevent aggregation deadlock
      hr = pDefSite->Init(pDP, pP, szProgId, fHatchWnd);
    }
  }
  return hr;
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:28,代码来源:boleips.cpp


示例5: NS_ENSURE_ARG_POINTER

HRESULT XPCDispObject::COMCreateInstance(XPCCallContext & ccx, BSTR className,
                                         PRBool enforceSecurity,
                                         IDispatch ** result)
{
    NS_ENSURE_ARG_POINTER(result);
    // Turn the string into a CLSID
    _bstr_t bstrName(className);
    CLSID classID = CLSID_NULL;
    HRESULT hr = CLSIDFromString(bstrName, &classID);
    if(FAILED(hr))
        hr = CLSIDFromProgID(bstrName, &classID);
    if(FAILED(hr) || ::IsEqualCLSID(classID, CLSID_NULL))
        return hr;
    
    // If the caller cares about security do the necessary checks
    // This results in the object being instantiated, so we'll use
    // it
    if(enforceSecurity)
        return SecurityCheck(ccx, classID, result);
    
    CComPtr<IDispatch> disp;
#ifdef JAXER
	hr = disp.CoCreateInstance(classID, NULL, CLSCTX_SERVER);
#else
    hr = disp.CoCreateInstance(classID);
#endif /* JAXER */
    if(FAILED(hr))
        return hr;

    disp.CopyTo(result);

    return S_OK;
}
开发者ID:dimitrianoudi,项目名称:Jaxer,代码行数:33,代码来源:XPCDispObject.cpp


示例6: CHECKPARAM

HRESULT tCOMUtil::ProgID2CLSID(CLSID *pClsid, const char *ProgID)
{
  CHECKPARAM(pClsid);
  
  // tests whether we already have a CLSID

  wchar_t* wcProgId = NULL;
  HRESULT hr = S_OK;

  if(ProgID[0] == '{')
  {
    wcProgId = (wchar_t*) malloc( (strlen(ProgID) + 1) * sizeof(wchar_t));
    mbstowcs(wcProgId, ProgID, strlen(ProgID)+1);

    hr = CLSIDFromString(wcProgId, pClsid);

    free(wcProgId);
    wcProgId = NULL;

    return hr;
  }

  /* converte ProgID para OLESTR */
  wcProgId = (wchar_t*) malloc( (strlen(ProgID) + 1) * sizeof(wchar_t));
  mbstowcs(wcProgId, ProgID, strlen(ProgID)+1);

  hr = CLSIDFromProgID(wcProgId, pClsid);

  free(wcProgId);
  wcProgId = NULL;

  return hr;
}
开发者ID:mentaldease,项目名称:bastionlandscape,代码行数:33,代码来源:tCOMUtil.cpp


示例7: iOleControlCreateMethod

static int iOleControlCreateMethod(Ihandle* ih, void **params)
{
  CLSID clsid;

  if (!params || !(params[0]))
    return IUP_ERROR;

  char *progID = (char*)params[0];

  /* free the data alocated by IupCanvas */
  if (ih->data) free(ih->data);
  ih->data = iupALLOCCTRLDATA();

  /* change the IupCanvas default values */
  iupAttribSetStr(ih, "BORDER", "NO");

  /* IupCanvas callbacks */
  IupSetCallback(ih,"RESIZE_CB",(Icallback)iOleControlResize_CB);

  size_t len = strlen(progID)+1;
  wchar_t* wcProgId = (wchar_t*) malloc(len * sizeof(wchar_t));
  mbstowcs(wcProgId, progID, len);
  HRESULT hr = CLSIDFromProgID(wcProgId, &clsid);
  free(wcProgId);
  if(FAILED(hr))
    return IUP_ERROR;

  ih->data->olehandler = new tOleHandler();
  if (ih->data->olehandler->Create(&clsid) == CREATE_FAILED)
    return IUP_ERROR;

  return IUP_NOERROR;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:33,代码来源:iup_olecontrol.cpp


示例8: sendPUTRequest

void sendPUTRequest(const std::string& server, const std::string& data)
{
    HRESULT hr;
    CLSID clsid;
    IWinHttpRequest *pIWinHttpRequest = NULL;

    _variant_t varFalse(false);
    _variant_t varData(data.c_str());

    hr = CLSIDFromProgID(L"WinHttp.WinHttpRequest.5.1", &clsid);
    if (SUCCEEDED(hr)){
        hr = CoCreateInstance(clsid, NULL,
            CLSCTX_INPROC_SERVER,
            IID_IWinHttpRequest,
            (void **)&pIWinHttpRequest);
    }

    if (SUCCEEDED(hr)){
        hr = pIWinHttpRequest->SetTimeouts(1000, 1000, 2000, 1000);
    }

    if (SUCCEEDED(hr)){
        _bstr_t method("PUT");
        _bstr_t url(server.c_str());
        hr = pIWinHttpRequest->Open(method, url, varFalse);
    }

    if (SUCCEEDED(hr)){
        hr = pIWinHttpRequest->Send(varData);
    }

    pIWinHttpRequest->Release();
}
开发者ID:zeriyoshi,项目名称:LunaDLL,代码行数:33,代码来源:GlobalFuncs.cpp


示例9: CLEAROUT

STDMETHODIMP TCUtilImpl::CreateObject(BSTR bstrProgID, BSTR bstrComputer,
  IUnknown** ppUnk)
{
  // Initialize the [out] parameter
  CLEAROUT(ppUnk, (IUnknown*)NULL);

  // Convert the specified ProgID to a CLSID
  CLSID clsid;
  if (!BSTRLen(bstrProgID))
    return E_INVALIDARG;
  RETURN_FAILED(CLSIDFromProgID(bstrProgID, &clsid));

  // Initialize the COSERVERINFO and MULTI_QI structures
  COSERVERINFO csi   = {0, bstrComputer, NULL, 0};
  MULTI_QI     mqi[] =
  {
    {&IID_IUnknown                 , NULL, S_OK},
    {&IID_IDispatch                , NULL, S_OK},
    {&IID_IConnectionPointContainer, NULL, S_OK},
  };
  const static ULONG cMQI = sizeofArray(mqi);

  // Determine if the specified computer name is definitely local
  bool bLocalForSure = true;
  if (BSTRLen(bstrComputer))
  {
    TCHAR szLocal[MAX_COMPUTERNAME_LENGTH + 1];
    DWORD cchLocal = sizeofArray(szLocal);
    GetComputerName(szLocal, &cchLocal);
    USES_CONVERSION;
    bLocalForSure = !_tcsicmp(szLocal, OLE2CT(bstrComputer));
  }
  DWORD dwClsCtx = bLocalForSure ? CLSCTX_SERVER : CLSCTX_REMOTE_SERVER;

  // Attempt to create the instance
  HRESULT hr = CoCreateInstanceEx(clsid, NULL, dwClsCtx, &csi, cMQI, mqi);
  if (FAILED(hr))
  {
    _TRACE_BEGIN
      _TRACE_PART1("TCCreateObject failed: hr=0x%08X", hr);
      _TRACE_PART1(", dwClsCtx=%hs", (CLSCTX_SERVER == dwClsCtx) ?
        "CLSCTX_SERVER" : "CLSCTX_REMOTE_SERVER");
      _TRACE_PART1(", ProgID=\"%ls\"", bstrProgID);
      _TRACE_PART1(", Computer= \"%ls\"\n", bstrComputer ?
        bstrComputer : L"");
    _TRACE_END
    return hr;
  }

  // Copy the IUnknown interface pointer to the [out] parameter
  *ppUnk = mqi[0].pItf;

  // Release each interface not being returned
  for (ULONG i = 1; i < cMQI; ++i)
    if (mqi[i].pItf)
      mqi[i].pItf->Release();

  // Return the result of the QI for IUnknown
  return mqi[0].hr;
}
开发者ID:borgified,项目名称:Allegiance,代码行数:60,代码来源:UtilImpl.cpp


示例10: StartExcel

BOOL CXLAutomation::StartExcel()
{
	CLSID clsExcelApp;

	// if Excel is already running, return with current instance
	if (m_pdispExcelApp != NULL)
		return TRUE;

	/* Obtain the CLSID that identifies EXCEL.APPLICATION
	 * This value is universally unique to Excel versions 5 and up, and
	 * is used by OLE to identify which server to start.  We are obtaining
	 * the CLSID from the ProgID.
	 */
	if (FAILED(CLSIDFromProgID(L"Excel.Application", &clsExcelApp))) 
	{
		MessageBox(NULL, _T("Cannot obtain CLSID from ProgID"), "Failed", MB_OK | MB_ICONSTOP);
		return FALSE;
	}

	// start a new copy of Excel, grab the IDispatch interface
	if (FAILED(CoCreateInstance(clsExcelApp, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void**)&m_pdispExcelApp))) 
	{
		MessageBox(NULL, _T("Cannot start an instance of Excel for Automation."), "Failed", MB_OK | MB_ICONSTOP);
		return FALSE;
	}

	return TRUE;

}
开发者ID:epapatzikou,项目名称:nexta,代码行数:29,代码来源:XLAutomation.cpp


示例11: Host_CreateObject

static HRESULT WINAPI Host_CreateObject(IHost *iface, BSTR ProgID, BSTR Prefix,
        IDispatch **out_Dispatch)
{
    IUnknown *unk;
    GUID guid;
    HRESULT hres;

    TRACE("(%s %s %p)\n", wine_dbgstr_w(ProgID), wine_dbgstr_w(Prefix), out_Dispatch);

    if(Prefix && *Prefix) {
        FIXME("Prefix %s not supported\n", debugstr_w(Prefix));
        return E_NOTIMPL;
    }

    hres = CLSIDFromProgID(ProgID, &guid);
    if(FAILED(hres))
        return hres;

    hres = CoCreateInstance(&guid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER|CLSCTX_REMOTE_SERVER,
            &IID_IUnknown, (void**)&unk);
    if(FAILED(hres))
        return hres;

    hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)out_Dispatch);
    IUnknown_Release(unk);
    return hres;
}
开发者ID:AlexSteel,项目名称:wine,代码行数:27,代码来源:host.c


示例12: get_content_type

static enum content get_content_type(LPCOLESTR name, CLSID *control_id)
{
    WCHAR new_urlW[MAX_PATH];
    DWORD size = MAX_PATH;
    WCHAR mshtml_prefixW[] = {'m','s','h','t','m','l',':','\0'};

    if (!name || !name[0])
    {
        WARN("name %s\n", wine_dbgstr_w(name));
        return IsEmpty;
    }

    if (CLSIDFromString(name, control_id) == S_OK ||
        CLSIDFromProgID(name, control_id) == S_OK)
        return IsGUID;

    if (PathIsURLW (name) ||
        UrlApplySchemeW(name, new_urlW, &size, URL_APPLY_GUESSSCHEME|URL_APPLY_GUESSFILE) == S_OK)
    {
        *control_id = CLSID_WebBrowser;
        return IsURL;
    }

    if (!strncmpiW(name, mshtml_prefixW, 7))
    {
        FIXME("mshtml prefix not implemented\n");
        *control_id = CLSID_WebBrowser;
        return IsHTML;
    }

    return IsUnknown;
}
开发者ID:Strongc,项目名称:reactos,代码行数:32,代码来源:atl_ax.c


示例13: CLSIDFromProgID

    void excelreader::InstanceExcelWorkbook(int visible)
    {
        // get CLSID of excel
        CLSID clsid;
        HRESULT hr = CLSIDFromProgID(L"Excel.Application", &clsid);
        if (FAILED(hr))
        {
            throw ExcelException("start excel failed. confirm excel installed");
        }

        // instance app
       // hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER,
       //                       IID_IDispatch, (void **)&pXlApp);
		hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void **)&pXlApp);
        if (FAILED(hr))
        {
            throw ExcelException("start excel failed. confirm excel installed");
        }

        // display, set Application.Visible to 1
        _variant_t x((long)visible);
        AutoWrap(DISPATCH_PROPERTYPUT, NULL, pXlApp, L"Visible", 1, (VARIANT)x);

        // get workbooks
        _variant_t result;
        AutoWrap(DISPATCH_PROPERTYGET, &result, pXlApp, L"Workbooks", 0);
        pXlBooks = result.Detach().pdispVal;
    }
开发者ID:zhili,项目名称:GeCellGenerator,代码行数:28,代码来源:excelreader.cpp


示例14: CLSIDFromProgID

void CAboutDlg::FillObjectVersion(LPCTSTR szProgID)
{
	CLSID cls;
	USES_CONVERSION;
	CLSIDFromProgID(T2W(szProgID), &cls);
	FillObjectVersion(cls);
}
开发者ID:AlexS2172,项目名称:IVRMstandard,代码行数:7,代码来源:AboutDlg.cpp


示例15: ImportDotXSI

void ImportDotXSI()
{

	CComPtr<XSIApplication>						l_pApplication;
	CLSID	lclsid;
	CLSIDFromProgID(L"XSI.Application", &lclsid );
	CoCreateInstance(lclsid, NULL, CLSCTX_INPROC, IID_XSIApplication, (void **)&l_pApplication);

	_variant_t args;  
	_variant_t v;  
	long l = 0 ;

	SAFEARRAY* psa = NULL;  
 
	const int cntArgs = 1 ;

	psa = ::SafeArrayCreateVector( VT_VARIANT, 0, cntArgs );  
 
	args.vt = VT_VARIANT | VT_ARRAY;  
	args.parray = psa;
 
	v = _bstr_t ( "c:\\__tmp.xsi" );
 
	SafeArrayPutElement(psa, &l, &v);  
	l++;  
 
	// more args?
	//

	VARIANT	l_vOutValue;
	l_pApplication->ExecuteScriptCommand( _bstr_t( L"SIImportDotXSIFile" ), args, &l_vOutValue ) ;


}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:34,代码来源:VMFImport.cpp


示例16: WinExec

DmSoft::DmSoft(){
	WinExec("regsvr32 /s dm.dll", SW_HIDE);
	//?注册
	CoInitialize(NULL);
	CLSID clsid;
	//?利用“根名称.类名”获取CLSID,&就是把指针给函数,也就是传址
	HRESULT hr = CLSIDFromProgID(OLESTR("dm.dmsoft"), &clsid);
	dmSoft.CreateDispatch(clsid);
}
开发者ID:xylsxyls,项目名称:xueyelingshuang,代码行数:9,代码来源:DmSoft.cpp


示例17: m_ref

CTypeScript::CTypeScript() : m_ref(1)
{
	InterlockedIncrement(&ulLockCount);

	CLSID CLSID_Script;
	CLSIDFromProgID(L"JScript", &CLSID_Script);

	CoCreateInstance(CLSID_Script, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&m_js));
}
开发者ID:tmyt,项目名称:ActiveTypeScript,代码行数:9,代码来源:TypeScript.cpp


示例18: StartPlugin

int StartPlugin(){

    //Create an instance of our VB COM object, and execute
	//one of its methods so that it will load up and show a UI
	//for us, then it uses our other exports to access olly plugin API
	//methods

	CLSID      clsid;
	HRESULT	   hr;
    LPOLESTR   p = OLESTR("IDACompare.CPlugin");

    hr = CoInitialize(NULL);

	 hr = CLSIDFromProgID( p , &clsid);
	 if( hr != S_OK  ){
		 MessageBox(0,"Failed to get Clsid from string\n","",0);
		 return 0;
	 }

	 // create an instance and get IDispatch pointer
	 hr =  CoCreateInstance( clsid,
							 NULL,
							 CLSCTX_INPROC_SERVER,
							 IID_IDispatch  ,
							 (void**) &IDisp
						   );

	 if ( hr != S_OK )
	 {
	   MessageBox(0,"CoCreate failed","",0);
	   return 0;
	 }

	 OLECHAR *sMethodName = OLESTR("DoPluginAction");
	 DISPID  dispid; // long integer containing the dispatch ID

	 // Get the Dispatch ID for the method name
	 hr=IDisp->GetIDsOfNames(IID_NULL,&sMethodName,1,LOCALE_USER_DEFAULT,&dispid);
	 if( FAILED(hr) ){
	    MessageBox(0,"GetIDS failed","",0);
		return 0;
	 }

	 DISPPARAMS dispparams;
	 VARIANTARG vararg[1]; //function takes one argument
	 VARIANT    retVal;

	 VariantInit(&vararg[0]);
	 dispparams.rgvarg = &vararg[0];
	 dispparams.cArgs = 0;  // num of args function takes
	 dispparams.cNamedArgs = 0;

	 // and invoke the method
	 hr=IDisp->Invoke( dispid, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &dispparams, &retVal, NULL, NULL);

	 return 0;
}
开发者ID:jkennelly,项目名称:IDACompare,代码行数:57,代码来源:idacompare.cpp


示例19: php3_COM_load

/* {{{ proto int com_load(string module_name)
   Loads a COM module */
void php3_COM_load(INTERNAL_FUNCTION_PARAMETERS)
{
	pval *module_name;
	CLSID clsid;
	HRESULT hr;
	OLECHAR *ProgID;
	IUnknown FAR *i_unknown = NULL;
	IDispatch FAR *i_dispatch = NULL;
	char *error_message;
	char *clsid_str;
	int i;

	if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &module_name)==FAILURE) {
		WRONG_PARAM_COUNT;
	}

	convert_to_string(module_name);
	ProgID = (OLECHAR *) emalloc(sizeof(OLECHAR)*(module_name->value.str.len+1));
	for (i=0; i<module_name->value.str.len; i++) {
		ProgID[i] = module_name->value.str.val[i];
	}
	ProgID[i] = 0;
	hr=CLSIDFromProgID(ProgID, &clsid);
	efree(ProgID);

	/* obtain CLSID */
	if (FAILED(hr)) {
		error_message = _php3_COM_error_message(hr);
		php3_error(E_WARNING,"Invalid ProgID:  %s\n", error_message);
		LocalFree(error_message);
		RETURN_FALSE;
	}

	/* obtain IUnknown */
	if (FAILED(hr=CoCreateInstance(&clsid, NULL, CLSCTX_ALL, &IID_IUnknown, (void FAR* FAR*) &i_unknown))) {
		error_message = _php3_COM_error_message(hr);
		clsid_str = _php3_string_from_clsid(&clsid);
		php3_error(E_WARNING,"Unable to obtain IUnknown interface for CLSID %s:  %s",clsid_str,error_message);
		LocalFree(error_message);
		efree(clsid_str);
		RETURN_FALSE;
	}

	/* obtain IDispatch */
	if (FAILED(hr=i_unknown->lpVtbl->QueryInterface(i_unknown, &IID_IDispatch, (void FAR* FAR*) &i_dispatch))) {
		error_message = _php3_COM_error_message(hr);
		clsid_str = _php3_string_from_clsid(&clsid);
		php3_error(E_WARNING,"Unable to obtain IDispatch interface for CLSID %s:  %s",clsid_str,error_message);
		LocalFree(error_message);
		efree(clsid_str);
		RETURN_FALSE;
	}
	i_unknown->lpVtbl->Release(i_unknown);

	RETURN_LONG(php3_list_insert(i_dispatch,le_idispatch));
}
开发者ID:maiconschelter,项目名称:php-past,代码行数:58,代码来源:COM.c


示例20: FRL_EXCEPT_GUARD

CLSID ServerConnection::getCLSID()
{
	FRL_EXCEPT_GUARD();
	CLSID server_clsid = GUID_NULL;
	#if( FRL_CHARACTER == FRL_CHARACTER_UNICODE )
		if( FAILED(CLSIDFromProgID( server_id.c_str(), &server_clsid)) )
		{
			if( UuidFromString( (unsigned short*)server_id.c_str(), &server_clsid) != RPC_S_OK )
				FRL_THROW_S_CLASS( NotResolveProgID );
		}
	#else
		if( FAILED(CLSIDFromProgID( string2wstring( server_id ).c_str(), &server_clsid)) )
		{
			if( UuidFromString( (unsigned char*)server_id.c_str(), &server_clsid) != RPC_S_OK )
				FRL_THROW_S_CLASS( NotResolveProgID );
		}	
	#endif // FRL_CHARACTER_UNICODE
	return server_clsid;
}
开发者ID:fahram,项目名称:DataServer,代码行数:19,代码来源:frl_opc_da_client_server_connection.cpp



注:本文中的CLSIDFromProgID函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CLStatus函数代码示例发布时间:2022-05-30
下一篇:
C++ CLS1_SendHelpStr函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap