当前位置: 首页>>代码示例>>C++>>正文


C++ CComBSTR函数代码示例

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


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

示例1: main

int main(int argc, char* argv[])
{
	printf(" ***************************************\n");
	printf("(c) 2008 Standard MPEG Encoder\n");
	printf("Standard Mpeg Encoder & EncodeSample developed by\n");
	printf("Mark Essien for Standard MPEG\n");
	printf(" ***************************************\n\n");
	

	CoInitialize(0);
	
	// Lets' init graph1 and get it started. The file we are testing with is about 30 seconds long
	// so requires about 10 seconds to encode
	convert1.SetOutputFormat(SYSTEMSFORMAT_MPEG1, CONSTRAINT_NONE, VIDEOFORMAT_MPEG1, AUDIOFORMAT_MP2);
	convert1.SetFiles(CComBSTR("Z:\\Projects\\Standard MPEG\\Test Files\\test_in.mpg"), 
					 CComBSTR("Z:\\Projects\\Standard MPEG\\Test Files\\Output Files\\test_out_1.mpg"));
	
	if (FAILED(convert1.StartConversion()))
	{
		printf("Conversion failed\n");
	}
	
	// the graph will be started in a second thread
	// wait for 2 seconds
	Sleep(2000);

	// Let's start a second graph
	convert2.SetOutputFormat(SYSTEMSFORMAT_MPEG1, CONSTRAINT_NONE, VIDEOFORMAT_MPEG1, AUDIOFORMAT_MP2);
	convert2.SetFiles(CComBSTR("Z:\\Projects\\Standard MPEG\\Test Files\\test_in.mpg"), 
					 CComBSTR("Z:\\Projects\\Standard MPEG\\Test Files\\Output Files\\test_out_2.mpg"));
	
	if (FAILED(convert2.StartConversion()))
	{
		printf("Conversion failed\n");
	}

	// wait 5 seconds
	Sleep(5000);

	// Let's start a third graph
	convert3.SetOutputFormat(SYSTEMSFORMAT_MPEG1, CONSTRAINT_NONE, VIDEOFORMAT_MPEG1, AUDIOFORMAT_MP2);
	convert3.SetFiles(CComBSTR("Z:\\Projects\\Standard MPEG\\Test Files\\test_in.mpg"), 
					 CComBSTR("Z:\\Projects\\Standard MPEG\\Test Files\\Output Files\\test_out_3.mpg"));
	
	if (FAILED(convert3.StartConversion()))
	{
		printf("Conversion failed\n");
	}

	// Now we wait for graph 1 to end
	convert1.WaitForCompletion();
	convert1.StopConversion();

	// Now we wait for graph 2 to end
	convert2.WaitForCompletion();
	convert2.StopConversion();

	// we restart graph1
	convert1.SetOutputFormat(SYSTEMSFORMAT_MPEG1, CONSTRAINT_NONE, VIDEOFORMAT_MPEG1, AUDIOFORMAT_MP2);
	convert1.SetFiles(CComBSTR("Z:\\Projects\\Standard MPEG\\Test Files\\test_in.mpg"), 
					 CComBSTR("Z:\\Projects\\Standard MPEG\\Test Files\\Output Files\\test_out_1b.mpg"));
	
	if (FAILED(convert1.StartConversion()))
	{
		printf("Conversion failed\n");
	}

	// wait for graph 3 to complete
	convert3.WaitForCompletion();
	convert3.StopConversion();

	
	// We wait for graph 1b to end
	convert1.WaitForCompletion();
	convert1.StopConversion();

	printf("\n\n\n***************************************\n\n");
	printf("Conversion complete. Press any key to exit");

	_getch(); // wait for user to press a key

	return 0;
}
开发者ID:BlackMael,项目名称:DirectEncode,代码行数:83,代码来源:EncodeSample.cpp

示例2: CreateToolbars

void CreateToolbars()
{
	if (Glb_toolbarArray.GetCount() > 0)
		return;

	IAcadMenuGroup *mnuGrp = NULL;
	if (!getAcadMenuGroup(&mnuGrp))
		return ;

	IAcadToolbars  *tlbrs = NULL;
	HRESULT hr = S_OK;
	hr = mnuGrp->get_Toolbars(&tlbrs);
	mnuGrp->Release();

	// 得到arx所在路径
	TCHAR lpPath[MAX_PATH] = {0};
	GetModuleFileName(GetModuleHandle("DistToolBar.arx"), lpPath, MAX_PATH);
	PathRemoveFileSpec(lpPath);
	PathAddBackslash(lpPath);

	CString strXmlFile = lpPath;
	strXmlFile += "toolbar.xml";

	// 得到icon路径
	PathAppend(lpPath, "icon");
	PathAddBackslash(lpPath);

	MSXML2::IXMLDOMDocumentPtr lpDocument;
	hr = lpDocument.CreateInstance(__uuidof(DOMDocument));

	if ( FAILED(hr) ) 
		_com_raise_error(hr);

	VARIANT_BOOL isSuccessful;

	// 装载XML字符串
	if (!lpDocument->load(_variant_t(strXmlFile)))
	{
		OutputDebugString("LoadXML failed!");

		return;
	}

	MSXML2::IXMLDOMElementPtr lpDocElement = NULL;
	lpDocument->get_documentElement(&lpDocElement);

	// toolbar list
	MSXML2::IXMLDOMNodeListPtr lpToolbarList = lpDocElement->getElementsByTagName(_bstr_t("toolbar"));

	MSXML2::IXMLDOMNodePtr lpToolbar = NULL;

	for ( ; (lpToolbar = lpToolbarList->nextNode()) != NULL ; )
	{

		MSXML2::IXMLDOMNodePtr lpCaptionNode = lpToolbar->attributes->getNamedItem("caption");
		CString strCaption = (char*)lpCaptionNode->text;

		OutputDebugString(strCaption);

		// 添加工具条
		IAcadToolbar  *tlbr = NULL;
		hr = tlbrs->Add(CComBSTR(strCaption), &tlbr);

		if FAILED(hr)
			continue;

		Glb_toolbarArray.Add(strCaption);

		// button list
		MSXML2::IXMLDOMNodeListPtr lpButtonList = lpToolbar->GetchildNodes();

		MSXML2::IXMLDOMNodePtr lpButton = NULL;

		for ( ; (lpButton = lpButtonList->nextNode()) != NULL ; )
		{
			MSXML2::IXMLDOMNodePtr lpToolTipNode = lpButton->attributes->getNamedItem("tooltip");
			CString strToolTip = (char*)lpToolTipNode->text;

			MSXML2::IXMLDOMNodePtr lpCommandNode = lpButton->attributes->getNamedItem("command");
			CString strCommand = (char*)lpCommandNode->text;
			strCommand += " ";

			MSXML2::IXMLDOMNodePtr lpIconNode = lpButton->attributes->getNamedItem("icon");
			CString strIcon = (char*)lpIconNode->text;

			OutputDebugStringX("tooltip=%s, command=%s, icon=%s", strToolTip, strCommand, strIcon);

			// 添加工具按钮
			IAcadToolbarItem *button=NULL;
			VARIANT index;
			index.vt = VT_I4;
			index.lVal = 100l;

			VARIANT vtFalse;
			vtFalse.vt = VT_BOOL;
			vtFalse.boolVal = VARIANT_FALSE;

			CString strIconFile = lpPath;
			strIconFile += strIcon;

//.........这里部分代码省略.........
开发者ID:fredrikjonsson,项目名称:cadof72bian,代码行数:101,代码来源:DistToolbarManager.cpp

示例3: GetSite


//.........这里部分代码省略.........
                if (SUCCEEDED(pWindow->GetWindow(&hwndBrowser)))
                {
                    hwndBrowser = FindWindowEx(hwndBrowser, NULL, _T("Shell DocObject View"), NULL);
                    if (hwndBrowser)
                    {
                        hwndBrowser = FindWindowEx(hwndBrowser, NULL, _T("Internet Explorer_Server"), NULL);
                    }
                }

                pWindow->Release();
            }
         
            pServiceProvider->Release();
        } 
    }

    // Nobody else seems to know how to get IViewObject2?!
    // http://starkravingfinkle.org/blog/2004/09/
    spViewObject = spDocument;
    if (spViewObject == NULL)
    {
        Error(L"Unable to convert document to view object.");
        return E_FAIL;
    }

    CComQIPtr<IHTMLDocument5> spDocument5;
    spDocument->QueryInterface(IID_IHTMLDocument5, (void**)&spDocument5);
    if (spDocument5 == NULL)
    {
        Error(L"Snapsie requires IE6 or greater.");
        return E_FAIL;
    }

    CComBSTR compatMode;
    spDocument5->get_compatMode(&compatMode);

    // In non-standards-compliant mode, the BODY element represents the canvas.
    if (compatMode == L"BackCompat")
    {
        CComPtr<IHTMLElement> spBody;
        spDocument->get_body(&spBody);
        if (NULL == spBody)
        {
            return E_FAIL;
        }

        spBody->getAttribute(CComBSTR("scrollHeight"), 0, &documentHeight);
        spBody->getAttribute(CComBSTR("scrollWidth"), 0, &documentWidth);
        spBody->getAttribute(CComBSTR("clientHeight"), 0, &viewportHeight);
        spBody->getAttribute(CComBSTR("clientWidth"), 0, &viewportWidth);
    }

    // In standards-compliant mode, the HTML element represents the canvas.
    else
    {
        CComQIPtr<IHTMLDocument3> spDocument3;
        spDocument->QueryInterface(IID_IHTMLDocument3, (void**)&spDocument3);
        if (NULL == spDocument3)
        {
            Error(L"Unable to get IHTMLDocument3 handle from document.");
            return E_FAIL;
        }

        // The root node should be the HTML element.
        CComPtr<IHTMLElement> spRootNode;
        spDocument3->get_documentElement(&spRootNode);
开发者ID:nirvdrum,项目名称:SnapsIE,代码行数:67,代码来源:CoSnapsie.cpp

示例4: RETURN_IF_FAILED

STDMETHODIMP CTimelineLoadingService::OnFinish(IVariantObject *pResult)
{
	CComPtr<IObjArray> pItems;
	RETURN_IF_FAILED(m_pTimelineControl->GetItems(&pItems));
	UINT uiCount = 0;
	RETURN_IF_FAILED(pItems->GetCount(&uiCount));
	if (uiCount)
	{
		CComPtr<IVariantObject> pFirstItem;
		RETURN_IF_FAILED(pItems->GetAt(0, __uuidof(IVariantObject), (LPVOID*)&pFirstItem));
		CComVar vId;
		RETURN_IF_FAILED(pFirstItem->GetVariantValue(ObjectModel::Metadata::Object::Id, &vId));
		CComVar vObjectType;
		RETURN_IF_FAILED(pFirstItem->GetVariantValue(ObjectModel::Metadata::Object::Type, &vObjectType));
		if (vId.vt == VT_I4 && vObjectType.vt == VT_BSTR && vId.intVal == CUSTOM_OBJECT_LOADING_ID && CComBSTR(vObjectType.bstrVal) == Twitter::Metadata::Types::CustomTimelineObject)
		{
            {
                CUpdateScope scope(m_pTimelineControl);
                RETURN_IF_FAILED(m_pTimelineControl->RemoveItemByIndex(0));
            }

            if (uiCount == 1)
            {
                HWND hWnd = 0;
                RETURN_IF_FAILED(m_pTimelineControl->GetHWND(&hWnd));
                InvalidateRect(hWnd, nullptr, true);
            }
		}
	}

	return S_OK;
}
开发者ID:ip821,项目名称:minitwi,代码行数:32,代码来源:TimelineLoadingService.cpp

示例5: GetStringValue

HRESULT CXMLDocument::SetFYSError()
{
	CString strErrorNode = m_strErrorNode;
	strErrorNode.MakeUpper();

	if (strErrorNode == "FILES")
	{
		MSXML2::IXMLDOMNodePtr pFilesNode;
		CComBSTR strValue;

		m_pDoc->selectSingleNode(CComBSTR("//FYS_DATASTREAMACKNOWLEDGMENT/FILES"), &pFilesNode);
		CString strStatus = GetStringValue("Status", pFilesNode);

		CString strDescription;
		strStatus.MakeUpper();
		if (strStatus == "INVALIDSTREAMFORMAT")
			strDescription = "Invalid Stream Header Xml.";
		if (strStatus == "INTERNALERROR")
			strDescription = "Unknown Error.";

		m_strErrorMessage.Format("Failed to send the card for printing!.\n"
									"Uploaded Files Count	: %s\n"
									"Uploaded Total Size	: %s\n"
									"Uploaded Files Status	: %s\n"
									"Error Description		: %s\n",
									GetStringValue("Count", pFilesNode),
									GetStringValue("TotalSize", pFilesNode),
									GetStringValue("Status", pFilesNode),
									strDescription);
	}

	if (strErrorNode == "FILE")
	{
		MSXML2::IXMLDOMNodePtr pFileNode;
		m_pDoc->selectSingleNode(CComBSTR("//FYS_DATASTREAMACKNOWLEDGMENT/FILES/FILE[@Status != 'OK']"), &pFileNode);

		m_strErrorMessage.Format("Failed to send the card for printing!.\n"
									"Uploaded File Name		: %s\n"
									"Uploaded File Size		: %s\n"
									"Uploaded File Status	: %s\n",
									GetStringValue("Name", pFileNode),
									GetStringValue("Size", pFileNode),
									GetStringValue("Status", pFileNode));
	}

	if (strErrorNode == "DATAENVELOPE")
	{
		MSXML2::IXMLDOMNodePtr pDtEnvNode;
		m_pDoc->selectSingleNode(CComBSTR("//FYS_DATASTREAMACKNOWLEDGMENT/DATAENVELOPE"), &pDtEnvNode);

		m_strErrorMessage.Format("Failed to send the card for printing!.\n"
									"Uploaded DataEnvelope Status: %s\n"
									"Error Description: %s\n",
									GetStringValue("Status", pDtEnvNode),
									"DataEnvelope file not received");
	}

	if (strErrorNode == "XMLPARSEERRORDETAILS")
	{
		MSXML2::IXMLDOMNodePtr pPrsErrNode;
		m_pDoc->selectSingleNode(CComBSTR("//FYS_DATASTREAMACKNOWLEDGMENT/DATAENVELOPE/XMLPARSEERRORDETAILS"), &pPrsErrNode);

		m_strErrorMessage.Format("Failed to send the card for printing!.\n"
									"Uploaded DataEnvelope file was malformed\n"
									"Error Description	: %s\n"
									"Error Text			: %s\n"
									"Error Location		: %s\n",
									GetStringValue("ErrorDescription", pPrsErrNode),
									GetStringValue("ErrorText", pPrsErrNode),
									GetStringValue("Location", pPrsErrNode));
	}

	return S_OK;
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:74,代码来源:CXMLDocument.cpp

示例6: CHECK_HR

HRESULT AbstractDeviceContent::GetValue(
            REFPROPERTYKEY         Key, 
    _Out_   IPortableDeviceValues* pStore)
{
    HRESULT hr = S_OK;
    PropVariantWrapper pvValue;

    if(pStore == NULL)
    {
        hr = E_POINTER;
        CHECK_HR(hr, "Cannot have NULL parameter");
        return hr;
    }

    if (IsEqualPropertyKey(Key, WPD_OBJECT_ID))
    {
        // Add WPD_OBJECT_ID
        pvValue = ObjectID;
        hr = pStore->SetValue(WPD_OBJECT_ID, &pvValue);
        CHECK_HR(hr, ("Failed to set WPD_OBJECT_ID"));
    }
    else if (IsEqualPropertyKey(Key, WPD_OBJECT_PERSISTENT_UNIQUE_ID))
    {
        // Add WPD_OBJECT_PERSISTENT_UNIQUE_ID
        pvValue = this->PersistentUniqueID;
        hr = pStore->SetValue(WPD_OBJECT_PERSISTENT_UNIQUE_ID, &pvValue);
        CHECK_HR(hr, ("Failed to set WPD_OBJECT_PERSISTENT_UNIQUE_ID"));
    }
    else if (IsEqualPropertyKey(Key, WPD_OBJECT_PARENT_ID))
    {
        // Add WPD_OBJECT_PARENT_ID
        pvValue = ParentID;
        hr = pStore->SetValue(WPD_OBJECT_PARENT_ID, &pvValue);
        CHECK_HR(hr, ("Failed to set WPD_OBJECT_PARENT_ID"));
    }
    else if (IsEqualPropertyKey(Key, WPD_OBJECT_NAME))
    {
        // Add WPD_OBJECT_NAME
        pvValue = Name;
        hr = pStore->SetValue(WPD_OBJECT_NAME, &pvValue);
        CHECK_HR(hr, ("Failed to set WPD_OBJECT_NAME"));
    }
    else if (IsEqualPropertyKey(Key, WPD_OBJECT_CONTENT_TYPE))
    {    
        // Add WPD_OBJECT_CONTENT_TYPE
        hr = pStore->SetGuidValue(WPD_OBJECT_CONTENT_TYPE, ContentType);
        CHECK_HR(hr, ("Failed to set WPD_OBJECT_CONTENT_TYPE"));
    }
    else if (IsEqualPropertyKey(Key, WPD_OBJECT_FORMAT))
    {
        // Add WPD_OBJECT_FORMAT
        hr = pStore->SetGuidValue(WPD_OBJECT_FORMAT, Format);
        CHECK_HR(hr, ("Failed to set WPD_OBJECT_FORMAT"));
    }
    else if (IsEqualPropertyKey(Key, WPD_OBJECT_CAN_DELETE))
    {
        // Add WPD_OBJECT_CAN_DELETE
        hr = pStore->SetBoolValue(WPD_OBJECT_CAN_DELETE, CanDelete);
        CHECK_HR(hr, ("Failed to set WPD_OBJECT_CAN_DELETE"));
    }
    else
    {
        hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
        CHECK_HR(hr, "Property {%ws}.%d is not supported", CComBSTR(Key.fmtid), Key.pid);
    }
    return hr;
}
开发者ID:340211173,项目名称:Driver,代码行数:67,代码来源:AbstractDeviceContent.cpp

示例7: DecodePointFromXML

void CStrokeRecognition::DecodePointFromXML(std::vector<POINT> &rgPoints, BSTR strXML)
{
	IXMLDOMDocument*		pDoc;
	IXMLDOMNodeList*		pNodeList;
	IXMLDOMNode*			pNode;
	IXMLDOMNode*			pInputNode;
	IXMLDOMNode*			pAttrNode;
	IXMLDOMNamedNodeMap*	pNodeMap;
	VARIANT_BOOL			bLoaded;
	VARIANT					value;
	BSTR					nodeName;
	POINT					pt;
	long					n;

	if (SUCCEEDED(CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument, (LPVOID*)&pDoc)))
	{
		pDoc->put_async(VARIANT_FALSE);
		pDoc->loadXML(strXML, &bLoaded);

		if (bLoaded == VARIANT_TRUE)
		{
			if (SUCCEEDED(pDoc->get_childNodes(&pNodeList)))
			{
				pInputNode = NULL;

				pNodeList->get_length(&n);

				for (int i = 0; i < n; i++)
				{
					if (SUCCEEDED(pNodeList->get_item(i, &pNode)))
					{
						nodeName = NULL;
						if (SUCCEEDED(pNode->get_nodeName(&nodeName)))
						{
							if (CComBSTR(nodeName) == L"input")
							{
								pInputNode = pNode;
								pInputNode->AddRef();
								break;
							}
							SysFreeString(nodeName);
						}
						pNode->Release();
					}
				}

				pNodeList->Release();

				if (pInputNode != NULL)
				{
					if (SUCCEEDED(pInputNode->get_childNodes(&pNodeList)))
					{
						pNodeList->get_length(&n);

						for (int i = 0; i < n; i++)
						{
							if (SUCCEEDED(pNodeList->get_item(i, &pNode)))
							{
								pt.x = 0;
								pt.y = 0;

								if (SUCCEEDED(pNode->get_attributes(&pNodeMap)))
								{
									if (SUCCEEDED(pNodeMap->getNamedItem(L"x", &pAttrNode)))
									{
										pAttrNode->get_nodeValue(&value);
										pt.x = _wtoi(value.bstrVal);
										pAttrNode->Release();
									}

									if (SUCCEEDED(pNodeMap->getNamedItem(L"y", &pAttrNode)))
									{
										pAttrNode->get_nodeValue(&value);
										pt.y = _wtoi(value.bstrVal);
										pAttrNode->Release();
									}

									pNodeMap->Release();
								}

								rgPoints.push_back(pt);

								pNode->Release();
							}
						}

						pNodeList->Release();
					}

					pInputNode->Release();
				}
			}
		}

		pDoc->Release();
	}
}
开发者ID:sanyaade-g2g-repos,项目名称:quickdiagram,代码行数:97,代码来源:StrokeRecognition.cpp

示例8: BuildClientInfoXml

/////////////////////////////////////////////////////////////////////////////
// CIbnCommandWnd message handlers
BOOL CIbnCommandWnd::OnCopyData(CWnd *pWnd, COPYDATASTRUCT *pCopyDataStruct)
{
    CComBSTR bstrCommandXML = (LPCWSTR)pCopyDataStruct->lpData;

    CComBSTR bstrCommandResponse;

    if(bstrCommandXML==L"clientInfo")
    {
        bstrCommandResponse = BuildClientInfoXml();
    }
    else if(bstrCommandXML==L"contactList")
    {
        bstrCommandResponse = BuildContactListXml();
    }
    else
    {
        CComPtr<IXMLDOMDocument>	xmlCommandDoc	=	NULL;
        xmlCommandDoc.CoCreateInstance(CLSID_DOMDocument40, NULL, CLSCTX_INPROC_SERVER);

        VARIANT_BOOL	varSuc	=	VARIANT_FALSE;
        xmlCommandDoc->loadXML(bstrCommandXML,&varSuc);

        if(varSuc==VARIANT_TRUE)
        {
            CComPtr<IXMLDOMNode>	pRootNode;
            xmlCommandDoc->selectSingleNode(CComBSTR(L"clientInfo"),&pRootNode);

            if(pRootNode!=NULL)
            {
                bstrCommandResponse = BuildClientInfoXml();
            }
            else
            {
                xmlCommandDoc->selectSingleNode(CComBSTR(L"contactList"),&pRootNode);
                if(pRootNode!=NULL)
                {
                    bstrCommandResponse = BuildContactListXml();
                }
                else
                {
                    xmlCommandDoc->selectSingleNode(CComBSTR(L"sendFile"),&pRootNode);
                    if(pRootNode!=NULL)
                    {
                        SendFile(pRootNode);
                    }

                    // TODO: Not Supported Command
                }
            }

        }
    }

    if(bstrCommandResponse.Length()>0)
    {
        // Send WM_COPYDATA
        COPYDATASTRUCT copyDs = {0};

        copyDs.cbData = (bstrCommandResponse.Length()+1)*2; // Specifies the size, in bytes, of the data pointed to by the lpData member.
        copyDs.lpData = (PVOID)(BSTR)bstrCommandResponse; // Pointer to data to be passed to the receiving application. This member can be NULL.

        LRESULT bResult = pWnd->SendMessage(WM_COPYDATA,
                                            (WPARAM)GetSafeHwnd(),
                                            (LPARAM)&copyDs);
    }

    return TRUE;
}
开发者ID:alex765022,项目名称:IBN,代码行数:70,代码来源:IbnCommandWnd.cpp

示例9: DlgResize_Init

LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	DlgResize_Init();
	// center the dialog on the screen
	CenterWindow();

	sAppTooltip="MtConnectDboard";
	nIcon=0;

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	//CMessageLoop* pLoop = _Module.GetMessageLoop();
	CMessageLoop* pLoop = _thread->GetMessageLoop();
	
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	// Remove Max/Min buttons - if using TrayIcon
	DWORD style = ::GetWindowLong(this->m_hWnd, GWL_STYLE);
	style &= ~(WS_MAXIMIZEBOX); // WS_MINIMIZEBOX NOT WS_THICKFRAME
	::SetWindowLong(this->m_hWnd, GWL_STYLE, style);

	// Install tray icon
	hSmileyIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME));
	hIdleIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_IDLEICON));
	hStopIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_STOPICON));
	hClearIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_CLEARICON));
	InstallIcon(sAppTooltip, hSmileyIcon, IDR_MENU1);

	CAxWindow wndIE = GetDlgItem(IDC_EXPLORER1);
	HRESULT hr;
	hr = wndIE.QueryControl ( &m_spWebBrowser );

	if ( m_spWebBrowser )
	{
		CComVariant v;  // empty variant
		m_spWebBrowser->Navigate ( CComBSTR("about:blank"), 
			&v, &v, &v, &v );
	}
	//Handle NavigateComplete2 event from the browser, get the document  element, call DispEventAdvise(pDocument). onclick event bubbles, so you  can handle it on the document and get clicks from all contained  elements.
	//DispEventAdvise(m_spWebBrowser); 

	//Then you need to register your interface to be used proccess wide:
	hr = pGIT->RegisterInterfaceInGlobal( (IUnknown*)(IWebBrowser2*)m_spWebBrowser, IID_IWebBrowser2, &dwWebBrowserCookie);

	//std::string html = MTConnectStreamsParser().CreateHtmlDocument();
	//CHtmlTableSnapshots().SetDocumentText(m_spWebBrowser,html);


	// Icon mapping
	std::vector<HICON> icons(2);
	icons[0]=hSmileyIcon; icons[1]=hClearIcon;	StateIconMap["EXECUTING"] = icons; // flashing green
	icons[0]=hSmileyIcon; icons[1]=hSmileyIcon;	StateIconMap["IDLE"] = icons; // idle auto
	icons[0]=hStopIcon;    icons[1]=hStopIcon;	StateIconMap["STOPPED"] = icons; // stopped
	icons[0]=hStopIcon;    icons[1]=hClearIcon;	StateIconMap["FAULT"] = icons; // stopped fault

	this->SetTimer(1, 250); 

	dlgMainThead = ::GetCurrentThread();
	return TRUE;
}
开发者ID:amanrenishaw,项目名称:MTConnectGadgets,代码行数:71,代码来源:MainDlg.cpp

示例10: GetOptionInt

CComBSTR CIbnCommandWnd::BuildContactListXml()
{
    USES_CONVERSION;

    CUserCollection	UsersContactList;
    pMessenger->GetCopyContactList(UsersContactList);

    CComPtr<IXMLDOMDocument>	pTreeItemDoc	=	NULL;

    pTreeItemDoc.CoCreateInstance(CLSID_DOMDocument40, NULL, CLSCTX_INPROC_SERVER);

    VARIANT_BOOL	varSuc	=	VARIANT_FALSE;
    CComBSTR	bsDefaultXML	= L"<contactList><response></response></contactList>";

    pTreeItemDoc->loadXML(bsDefaultXML,&varSuc);

    CComPtr<IXMLDOMNode>	pRootNode;
    pTreeItemDoc->selectSingleNode(CComBSTR(L"contactList/response"),&pRootNode);

    int CLMode  = GetOptionInt(IDS_OFSMESSENGER,IDS_CLMODE,2);

    CUser* pUser=NULL;

    int GroupGlobalId = -1;
    if(POSITION pos = UsersContactList.InitIteration())
    {
        for(int i=0; UsersContactList.GetNext(pos, pUser); i++)
        {
            // Step 1. Проверить создавали ли мы группу???
            CComBSTR	GroupName =	pUser->m_strType;

            if(CLMode==2)
            {
                if(pUser->m_iStatus==S_OFFLINE||pUser->m_iStatus==S_INVISIBLE)
                {
                    GroupName	=  GetString(IDS_OFFLINE);
                }
            }

            BOOL isCheck = FALSE;

            CComBSTR bsGroupPath = L"contactList/response/group[@name='";
            bsGroupPath += GroupName;
            bsGroupPath += L"']";

            CComPtr<IXMLDOMNode>	pGroupNode;

            pTreeItemDoc->selectSingleNode(bsGroupPath,&pGroupNode);

            if(pGroupNode==NULL)
            {
                CComPtr<IXMLDOMNode>	pTmpGroupNode;

                pTreeItemDoc->createNode(CComVariant(NODE_ELEMENT),CComBSTR(L"group"),NULL,&pTmpGroupNode);

                SetAttribute(pTmpGroupNode,CComBSTR(L"name"),CComVariant(GroupName));

                pGroupNode = AppendWithSort(pRootNode, pTmpGroupNode, CComBSTR(L"text"));
            }

            // Step 3. добавить пользователя [1/28/2002]
            CComPtr<IXMLDOMNode> pUserNode;

            insertSingleNode(pGroupNode, CComBSTR(L"user"), NULL, NULL, &pUserNode);

            WCHAR buffUserId[20]	=	L"";
            _ltow(pUser->GetGlobalID(),buffUserId,10);

            WCHAR buffUserStatus[20]	=	L"";
            _ltow(pUser-> GetStatus(),buffUserStatus,10);

            insertSingleNode(pUserNode, CComBSTR(L"id"), NULL, CComBSTR(buffUserId));
            insertSingleNode(pUserNode, CComBSTR(L"login"), NULL, CComBSTR((LPCTSTR)pUser->m_strLogin));
            insertSingleNode(pUserNode, CComBSTR(L"firstName"), NULL, CComBSTR((LPCTSTR)pUser->m_strFirstName));
            insertSingleNode(pUserNode, CComBSTR(L"lastName"), NULL, CComBSTR((LPCTSTR)pUser->m_strLastName));
            insertSingleNode(pUserNode, CComBSTR(L"email"), NULL, CComBSTR((LPCTSTR)pUser->m_strEMail));
            insertSingleNode(pUserNode, CComBSTR(L"status"), NULL, CComBSTR(buffUserStatus));
        }
    }

    CComBSTR bsRetVal;
    pTreeItemDoc->get_xml(&bsRetVal);

    return bsRetVal;
}
开发者ID:alex765022,项目名称:IBN,代码行数:85,代码来源:IbnCommandWnd.cpp

示例11: _ltow

BOOL CIbnCommandWnd::SendScreenCaptureCommand(CComBSTR Command, CComBSTR Mode, CComBSTR RecipientsXml)
{
    // Create Hwnd String
    WCHAR wsTmpBuf[20];
    _ltow((long)pMessenger->GetSafeHwnd(),wsTmpBuf,10);

    CComBSTR bstrClientHwnd = wsTmpBuf;

    // Create Xml Command
    CComBSTR sendXML;

    sendXML += CComBSTR(L"<");
    sendXML += Command;
    sendXML += CComBSTR(L">");

    sendXML += CComBSTR(L"<request>");
    sendXML += CComBSTR(L"<ibnClientHandle>");
    sendXML += bstrClientHwnd;
    sendXML += CComBSTR(L"</ibnClientHandle>");

    sendXML += CComBSTR(L"<mode>");
    sendXML += Mode;
    sendXML += L"</mode>";

    if(RecipientsXml.Length()>0)
    {
        sendXML += CComBSTR(L"<recipients>");
        sendXML += RecipientsXml;
        sendXML += L"</recipients>";
    }

    sendXML += CComBSTR(L"</request>");

    sendXML += CComBSTR(L"</");
    sendXML += Command;
    sendXML += CComBSTR(L">");

    // Test Only
    //sendXML = L"<clientInfo></clientInfo>";

    // TODO: Find Screen Capture Window
    LPCTSTR szScreenCaptureClassName = _T("#32770");
    LPCTSTR szScreenCaptureWindowName = _T("{19791104-A59E-42e5-BB49-200706080000}");

    CWnd *pScreenCaptureCommandWnd = FindWindow(szScreenCaptureClassName,szScreenCaptureWindowName);

    if(pScreenCaptureCommandWnd==NULL)
    {
        // TODO:
        CString screenCapurePath = pMessenger->ScreenCapturePath();

        // Run Screen Capture
        if(screenCapurePath.GetLength()>0)
        {
            HINSTANCE retVal = ShellExecute(::GetDesktopWindow(),NULL,screenCapurePath,_T(""),NULL,SW_SHOWNORMAL);

            if((int)retVal>32)
            {
                // Find Screen Capture Window Again
                for(int index=0; index<20; index++)
                {
                    Sleep(500);

                    pScreenCaptureCommandWnd = FindWindow(szScreenCaptureClassName,szScreenCaptureWindowName);
                    if(pScreenCaptureCommandWnd!=NULL)
                        break;
                }
            }
        }

    }

    if(pScreenCaptureCommandWnd!=NULL)
    {
        // Send WM_COPYDATA
        COPYDATASTRUCT copyDs = {0};

        copyDs.cbData = (sendXML.Length()+1)*2; // Specifies the size, in bytes, of the data pointed to by the lpData member.
        copyDs.lpData = (PVOID)(BSTR)sendXML; // Pointer to data to be passed to the receiving application. This member can be NULL.

        LRESULT bResult = pScreenCaptureCommandWnd->SendMessage(WM_COPYDATA,
                          (WPARAM)GetSafeHwnd(),
                          (LPARAM)&copyDs);

        return TRUE;
    }

    return FALSE;
}
开发者ID:alex765022,项目名称:IBN,代码行数:89,代码来源:IbnCommandWnd.cpp

示例12: pCont

HRESULT SoundDA::SetDaqHwInfo()
{    
    CComPtr<IProp> prop;     

    // hwinfo property container

    CComQIPtr<IPropContainer> pCont(GetHwInfo());   
        
    // total channels 
    CComVariant var,vids;
    short ids[]={1,2};
    if (WaveCaps.IsStereo())
    {
        var=2L;
        CreateSafeVector(ids,2,&vids);
    }
    else
    {
        var=1L;
        CreateSafeVector(ids,1,&vids);
    }

    HRESULT hRes = pCont->put_MemberValue(L"totalchannels",var);
    if (!(SUCCEEDED(hRes))) return hRes;        

    hRes = pCont->put_MemberValue(L"channelids", vids);
    if (!(SUCCEEDED(hRes))) return hRes;

    
    wchar_t idStr[8];
    swprintf(idStr, L"%d", _id);
    hRes = pCont->put_MemberValue(L"id", CComVariant(idStr));	
    if (!(SUCCEEDED(hRes))) return hRes;
    
    hRes = pCont->put_MemberValue(L"polarity", CComVariant(L"Bipolar"));
    if (!(SUCCEEDED(hRes))) return hRes;

    hRes = pCont->put_MemberValue(L"coupling", CComVariant(L"AC Coupled"));
    if (!(SUCCEEDED(hRes))) return hRes;

    // subsystem type
    hRes = pCont->put_MemberValue(L"subsystemtype",CComVariant(L"AnalogOutput"));
    if (!(SUCCEEDED(hRes))) return hRes;

    // autocal
    //hRes = pCont->put_MemberValue(CComBSTR(L"autocalibrate"),CComVariant(0L));
    //if (!(SUCCEEDED(hRes))) return hRes;
   
    hRes = pCont->put_MemberValue(L"sampletype",CComVariant(1L));
    if (!(SUCCEEDED(hRes))) return hRes;

    // number of bits
    CComVariant val;
    val = WaveCaps.Supports16Bit() ? 16L : 8L;
    hRes = pCont->put_MemberValue(CComBSTR(L"bits"),val);
    if (!(SUCCEEDED(hRes))) return hRes;
      
    hRes = pCont->put_MemberValue(L"adaptorname",
        CComVariant(L"winsound"));
    if (!(SUCCEEDED(hRes))) return hRes;

    // driver description    
    bstr_t name = WaveCaps.GetDeviceName();
    V_VT(&val) = VT_BSTR;
    V_BSTR(&val) = name;
    hRes = pCont->put_MemberValue(L"devicename",val);
    if (!(SUCCEEDED(hRes))) return hRes;    

    hRes = pCont->put_MemberValue(L"vendordriverdescription",
	CComVariant(L"Windows Multimedia Driver"));
    if (!(SUCCEEDED(hRes))) return hRes;
       
    hRes = pCont->put_MemberValue(L"vendordriverversion",CComVariant(WaveCaps.GetDriverVersion()));
    if (!(SUCCEEDED(hRes))) return hRes;

    // native data type
    var = WaveCaps.Supports16Bit() ? VT_I2 : VT_UI1;
    hRes = pCont->put_MemberValue(L"nativedatatype", var);	
    if (!(SUCCEEDED(hRes))) return hRes;


    SetSampleRateRange(8000,static_cast<long>(WaveCaps.GetMaxSampleRate()));

    // input ranges --> move to input group    
    SAFEARRAY *ps = SafeArrayCreateVector(VT_R8, 0, 2);
    if (ps==NULL) 
        return E_OUTOFMEMORY;

    val.parray=ps;
    val.vt = VT_ARRAY | VT_R8;

    double *pr;
    
    hRes = SafeArrayAccessData(ps, (void **) &pr);
    if (FAILED (hRes)) 
    {
        SafeArrayDestroy (ps);
        return hRes;
    }       

//.........这里部分代码省略.........
开发者ID:motor,项目名称:clock_stimulus,代码行数:101,代码来源:SoundDA.cpp

示例13: bstrXml

		LRESULT CTangramWordPlusDocWnd::OOpenDoc(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& )
		{
			map<LONG, Office::_CustomTaskPane*>::iterator it = m_pWordAddin->m_mapTaskPaneMap.find((LONG)m_hWnd);
			if (it != m_pWordAddin->m_mapTaskPaneMap.end())
			{
				it->second->put_Visible(false);
				m_pWordAddin->m_mapTaskPaneMap.erase(it);
			}
			if(m_pWordAddin->m_pCurWordPlusDocWnd==NULL)
				return 0;
			CTangramWordPlusDocWnd* pWnd = m_pWordAddin->m_pCurWordPlusDocWnd;
			pWnd->m_pWordPlusDoc = (CTangramWordPlusDoc*)wParam;
			if(lParam==1&& pWnd)
			{
				CComBSTR bstrXml(L"");
				m_pWordAddin->GetTangramXml(pWnd->m_pWordPlusDoc->m_pDoc,CComBSTR(L"Tangrams"),&bstrXml);
				CString strTemplateXml =  OLE2T(bstrXml);
				pWnd->m_pWordPlusDoc->m_strDocXml = strTemplateXml;

				if (strTemplateXml != _T(""))
				{
					CTangramXmlParse m_Parse;
					if (m_Parse.LoadXml(strTemplateXml) || m_Parse.LoadFile(strTemplateXml))
					{
						CTangramXmlParse* pParse = m_Parse.GetChild(_T("TaskPaneUI"));
						if (pParse)
							pWnd->m_pWordPlusDoc->m_strTaskPaneXml = pParse->xml();
						pParse = m_Parse.GetChild(_T("DocumentUI"));
						if (pParse)
						{
							CTangramWordPlusDoc* pWordDocument = pWnd->m_pWordPlusDoc;
							theApp.m_pTangramCore->CreateTangram((LONGLONG)pWnd->m_hWnd, &pWordDocument->m_pTangram);
							if (pWordDocument->m_pTangram)
							{
								pWordDocument->m_pTangram->put_External(pWordDocument->m_pDoc);
								pWordDocument->m_pTangram->CreateFrame(CComVariant(0), CComVariant((LONGLONG)m_pWordAddin->m_pCurWordPlusDocWnd->m_hDocWnd), CComBSTR(L"Document"), &pWordDocument->m_pFrame);
								if (pWordDocument->m_pFrame)
								{
									CString strXml = pParse->xml();
									CComPtr<ITangramNode> pNode;
									pWordDocument->m_pFrame->Extend(CComBSTR(L"Default"), strXml.AllocSysString(), &pNode);
								}
							}
						}
						pParse = m_Parse.GetChild(_T("UserForms"));
						if (pParse)
						{
							int nCount = pParse->GetCount();
							if (nCount)
							{
								for (int i = 0; i < nCount; i++)
								{
									CTangramXmlParse* pParse2 = pParse->GetChild(i);
									m_pWordPlusDoc->m_mapUserFormScript[pParse2->name()] = pParse2->xml();
								}
							}
						}
					}
				}
			}
			return 0;
		}
开发者ID:tangramfx,项目名称:TANGRAM,代码行数:62,代码来源:WordPlusDoc.cpp

示例14: CHECK_HR

HRESULT WpdCapabilities::DispatchWpdMessage(_In_ REFPROPERTYKEY          Command,
                                            _In_ IPortableDeviceValues*  pParams,
                                            _In_ IPortableDeviceValues*  pResults)
{
    HRESULT hr = S_OK;

    if (Command.fmtid != WPD_CATEGORY_CAPABILITIES)
    {
        hr = E_INVALIDARG;
        CHECK_HR(hr, "This object does not support this command category %ws",CComBSTR(Command.fmtid));
    }

    if (hr == S_OK)
    {
        if (IsEqualPropertyKey(Command, WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_COMMANDS))
        {
            hr = OnGetSupportedCommands(pParams, pResults);
            CHECK_HR(hr, "Failed to get supported commands");
        }
        else if (IsEqualPropertyKey(Command, WPD_COMMAND_CAPABILITIES_GET_COMMAND_OPTIONS))
        {
            hr = OnGetCommandOptions(pParams, pResults);
            CHECK_HR(hr, "Failed to get command options");
        }
        else if (IsEqualPropertyKey(Command, WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FUNCTIONAL_CATEGORIES))
        {
            hr = OnGetFunctionalCategories(pParams, pResults);
            CHECK_HR(hr, "Failed to get functional categories");
        }
        else if (IsEqualPropertyKey(Command, WPD_COMMAND_CAPABILITIES_GET_FUNCTIONAL_OBJECTS))
        {
            hr = OnGetFunctionalObjects(pParams, pResults);
            CHECK_HR(hr, "Failed to get functional objects");
        }
        else if (IsEqualPropertyKey(Command, WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_CONTENT_TYPES))
        {
            hr = OnGetSupportedContentTypes(pParams, pResults);
            CHECK_HR(hr, "Failed to get supported content types");
        }
        else if (IsEqualPropertyKey(Command, WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FORMATS))
        {
            hr = OnGetSupportedFormats(pParams, pResults);
            CHECK_HR(hr, "Failed to get supported formats");
        }
        else if (IsEqualPropertyKey(Command, WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FORMAT_PROPERTIES))
        {
            hr = OnGetSupportedFormatProperties(pParams, pResults);
            CHECK_HR(hr, "Failed to get supported format properties");
        }
        else if (IsEqualPropertyKey(Command, WPD_COMMAND_CAPABILITIES_GET_FIXED_PROPERTY_ATTRIBUTES))
        {
            hr = OnGetFixedPropertyAttributes(pParams, pResults);
            CHECK_HR(hr, "Failed to get fixed property attributes");
        }
        else if (IsEqualPropertyKey(Command, WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_EVENTS))
        {
            hr = OnGetSupportedEvents(pParams, pResults);
            CHECK_HR(hr, "Failed to get supported events");
        }
        else if (IsEqualPropertyKey(Command, WPD_COMMAND_CAPABILITIES_GET_EVENT_OPTIONS))
        {
            hr = OnGetEventOptions(pParams, pResults);
            CHECK_HR(hr, "Failed to get event options");
        }
        else
        {
            hr = E_NOTIMPL;
            CHECK_HR(hr, "This object does not support this command id %d", Command.pid);
        }
    }
    return hr;
}
开发者ID:340211173,项目名称:Windows-driver-samples,代码行数:72,代码来源:WpdCapabilities.cpp

示例15: GetModuleFileName

/////////////////////////////////////////////////////////////////////////////
// AdaptorInfo()
//
// The function is used to elicit relevant info about the current HW..
//..configuration from the HW API.
//  The info to extract is:
//..1)number of boards installed
//..2)board names
//..3)supported subsystems (AnalogInput, AnalogOutput, DigitalIO)
// The function is called by the engine in response to the ML user..
//..command DAQHWINFO 
/////////////////////////////////////////////////////////////////////////////
HRESULT Cadvantechadapt::AdaptorInfo(IPropContainer * Container)
{
	LONG lDriverHandle = (LONG)NULL;          // driver handle
	PT_DeviceGetFeatures ptDevFeatures;		// Devfeatures table
	DEVFEATURES DevFeatures;					// structure for device features
	
	int i = 0;          // Index variable
	
	// Get the name of the adaptor module
	TCHAR name[256];
	GetModuleFileName(_Module.GetModuleInstance(),name,256); // null returns MATLAB version (non existant)
	RETURN_HRESULT(Container->put_MemberValue(L"adaptordllname",CComVariant(name)));
	
	// Place the adaptor name in the appropriate struct in the engine.
	RETURN_HRESULT(Container->put_MemberValue(L"adaptorname",variant_t(ConstructorName)));
	
	// Find board IDs
	// Start by obtaining the DeviceList. Not stored.
	short numDevices;			// Number of devices
	DEVLIST deviceList[MaxDev]; // Space to store device information.
	CComVariant var;			// General CComVariant to return info to adaptor engine.
	RETURN_ADVANTECH(DRV_DeviceGetList((DEVLIST far *)&deviceList[0], MaxDev, &numDevices));
	
	// Create storage for board IDs, bord names and constructors.
	TSafeArrayVector<CComBSTR> IDs;			// Create A SafeArrayVector to store the IDs in
	IDs.Allocate(numDevices);				// Allocate the memory for the number of devices
	TSafeArrayVector<CComBSTR> Names;		// Create A SafeArrayVector to store the Names in
	Names.Allocate(numDevices);				// Allocate the memory for the number of devices
	SAFEARRAY *ps;							// SafeArray for the subsystem support [nDx3 CComBStrs]
	CComBSTR *subsystems;
	SAFEARRAYBOUND arrayBounds[2]; 
	arrayBounds[0].lLbound = 0;
	arrayBounds[0].cElements = numDevices;    
	arrayBounds[1].lLbound = 0;
	arrayBounds[1].cElements = 3;			// AnalogInput, AnalogOutput, DigitalIO subsystems.
	ps = SafeArrayCreate(VT_BSTR, 2, arrayBounds);
	if (ps==NULL)
		return E_FAIL;      
	
	// Set up the variant to contain subsystem constructor SafeArray
	var.parray = ps;
	var.vt = VT_ARRAY | VT_BSTR;
	HRESULT hRes = SafeArrayAccessData(ps, (void **)&subsystems);
	if (FAILED (hRes)) 
	{
		SafeArrayDestroy (ps);
		return hRes;
	}
	
	// Now loop through each device, getting the ID, BoardName and subsystem support.
	wchar_t str[40];
	for (i=0; i < numDevices; i++)
	{
		// Allocate the ID
		char* string;
		string = new char[20];
		_ltoa(deviceList[i].dwDeviceNum, string, 10);
		IDs[i] = CComBSTR(string);
		
		// Open Device
		RETURN_ADVANTECH(DRV_DeviceOpen(deviceList[i].dwDeviceNum,(LONG far *)&lDriverHandle));
		
		// Get BoardNames info
		Names[i] = CComBSTR(deviceList[i].szDeviceName);
		
		// Check to see which subsystems the current board supports.
		// Get device features
		ptDevFeatures.buffer = (LPDEVFEATURES)&DevFeatures;
		ptDevFeatures.size = sizeof(DEVFEATURES);
		RETURN_ADVANTECH(DRV_DeviceGetFeatures(lDriverHandle, (LPT_DeviceGetFeatures)&ptDevFeatures));
		if ((DevFeatures.usMaxAIDiffChl + DevFeatures.usMaxAISiglChl) > 0) 
		{
			swprintf(str, L"analoginput('%s',%s)", (wchar_t*)ConstructorName, (wchar_t*)IDs[i]);
			subsystems[i]=str;
		}
		if (DevFeatures.usMaxAOChl > 0)
		{
			swprintf(str, L"analogoutput('%s',%s)", (wchar_t*)ConstructorName, (wchar_t*)IDs[i]);
			subsystems[i + numDevices]=str;
		}
		if ((DevFeatures.usMaxDIChl + DevFeatures.usMaxDOChl) > 0)
		{
			swprintf(str, L"digitalio('%s',%s)",(wchar_t*) ConstructorName, (wchar_t*)IDs[i]);
			subsystems[i + 2*numDevices] = str;
		}  
		// Close device
		RETURN_ADVANTECH(DRV_DeviceClose((LONG far *)&lDriverHandle));
	}
//.........这里部分代码省略.........
开发者ID:motor,项目名称:clock_stimulus,代码行数:101,代码来源:advantechadapt.cpp


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