Ejemplo n.º 1
0
		int	AgilentRawData::GetSpecData(void)
		{
			HRESULT	res	= IIDFromString(L"{26E42183-9803-11D1-A9F6-0060977F5C78}", &mriid_wiff_file) ; 
			if (res == E_INVALIDARG)
			{
				throw "Unable to instantiate Agilent object: IFMANWiffFile from ExploreDataObjects.dll.  You will need to install Analyst on this computer first or convert your file to MZXml format using mzStar on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}

			CoInitialize( NULL );
			CLSID clsid	; 

			res	=  CLSIDFromString(L"{C09D0EF8-926D-11D1-A9F2-0060977F5C78}", &clsid );		
			if (res ==REGDB_E_WRITEREGDB)
			{
				throw "Unable to instantiate Agilent object: FManSpecData from ExploreDataObjects.dll. You will need to install Analyst on this computer first or convert your file to MZXml format using mzStar on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}

			IID	riid ;
			res	= IIDFromString(L"{C09D0EF7-926D-11D1-A9F2-0060977F5C78}", &riid) ;	
			if (res == E_INVALIDARG)
			{
				throw "Unable to instantiate Agilent object: FMANSpecData from ExploreDataObjects.dll.  You will need to install Analyst on this computer first or convert your file to MZXml format using mzStar on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}

			res	= CoCreateInstance(clsid, NULL,CLSCTX_INPROC_SERVER, riid, (void **) &mobj_spec_data);
			if(res != S_OK)
			{
				throw "Unable to instantiate Agilent object: FMANSpecData from ExploreDataObjects.dll.  You will need to install Analyst on this computer first or convert your file to MZXml format using mzStar on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}

			// clsid for FMANChromData
			res	= IIDFromString(L"{C09D0EF5-926D-11D1-A9F2-0060977F5C78}", &riid) ;	
			if (res == E_INVALIDARG)
			{
				throw "Unable to instantiate Agilent object: IFMANChromData from ExploreDataObjects.dll.  You will need to install Analyst on this computer first or convert your file to MZXml format using mzStar on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}

			res	=  CLSIDFromString(L"{C09D0EF6-926D-11D1-A9F2-0060977F5C78}", &clsid );		
			if (res ==REGDB_E_WRITEREGDB)
			{
				throw "Unable to instantiate Agilent object: IFMANChromData from ExploreDataObjects.dll. You will need to install Analyst on this computer first or convert your file to MZXml format using mzStar on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}
			res	= CoCreateInstance(clsid, NULL,CLSCTX_INPROC_SERVER, riid, (void **) &mobj_chrom_data);
			if(res != S_OK)
			{
				throw "Unable to instantiate Agilent object: IFMANChromData from ExploreDataObjects.dll.  You will need to install Analyst on this computer first or convert your file to MZXml format using mzStar on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}

			if(res != S_OK)
				return 1;


			return 0;
		}
Ejemplo n.º 2
0
bool InitializeIDebug()
{
    HRESULT Hr;
    char Buffer[1024];
    IID *piidIDebugClient = (IID*)Buffer;
    Hr = IIDFromString(L"{27fe5639-8407-4f47-8364-ee118fb08ac8}", piidIDebugClient);
    if (Hr != S_OK){
        dprintf("Failed to IIDFromString 1\n");
        return false;
    }
    Hr = DebugCreate(piidIDebugClient, (void**)&pDebugClient);
    if (Hr != S_OK){
        dprintf("Failed to DebugCreate\n");
        return false;
    }

    IID *piidIDebugControl = (IID*)Buffer;
    Hr = IIDFromString(L"{5182e668-105e-416e-ad92-24ef800424ba}", piidIDebugControl);
    if (Hr != S_OK){
        dprintf("Failed to IIDFromString 2\n");
        return false;
    }
    Hr = pDebugClient->lpVtbl->QueryInterface(pDebugClient, piidIDebugControl, (void**)&pDebugControl);
    if (Hr != S_OK){
        dprintf("Failed to QueryInterface\n");
        return false;
    }

    /*
    IID *piidIDebugEventCallbacks = (IID*)Buffer;
    Hr = IIDFromString(L"{337be28b-5036-4d72-b6bf-c45fbb9f2eaa}", piidIDebugEventCallbacks);
    if (Hr != S_OK){
        dprintf("Failed to IIDFromString 3\n");
        return false;
    }
    Hr = pDebugClient->lpVtbl->QueryInterface(pDebugClient, piidIDebugEventCallbacks, (void**)&g_pDebugEventCallbacks);
    if (Hr != S_OK){
        dprintf("Failed to QueryInterface 3\n");
        return false;
    }
    */

    return true;
}
Ejemplo n.º 3
0
void CRTFReaderTHDDlg::OnHide() 
{

	try
	{
		EnableReaders(false);

		IWSRTFFile* pFile1 = NULL;

		USES_CONVERSION;
		IID iidRtfFile;
		IIDFromString(T2W(_T("{") _T(_IID_IWSRTFFile) _T("}")), &iidRtfFile);

		CLSID clsidRtfFile;
		CLSIDFromProgID(T2W(_T(_PROGID_WSRTFFile)), &clsidRtfFile);
		HRESULT hr=CoCreateInstance(clsidRtfFile,NULL,CLSCTX_INPROC_SERVER,iidRtfFile, reinterpret_cast<void**> (&pFile1));

		if (SUCCEEDED(hr))
		{

			pFile1->InputFileName=_bstr_t(m_csFile1);
			pFile1->OutputFileName=_bstr_t(CString(CGeneral::GetTemporaryPath().c_str())+_T("\\Hide.rtf"));

			pFile1->ReadFile();

			pFile1->Greek(0);

			pFile1->WriteFile();

			pFile1->Release();


		}
		EnableReaders(true);
	}
	catch(...)
	{
		// Exception thrown
		ASSERT(false);
	}
}
Ejemplo n.º 4
0
int main(int argc, char* argv[])
{
	IConvertGuidPtr CvrtGuid;
	CvrtGuid.CreateInstance(CLSID_ConvertGuid);

	for (int i = 0; i < 100; ++i) {
	GUID Guid, Guid2;
	BSTR bstrGuid, bstrGuid32;
	wchar_t wBuffer[80];
		
		CoCreateGuid(&Guid);
		StringFromGUID2(Guid, wBuffer, sizeof(wBuffer));
		CvrtGuid->GuidToGuid32String(bstr_t(wBuffer), &bstrGuid32);
		CvrtGuid->Guid32StringToGuid(bstrGuid32, &bstrGuid);
		IIDFromString(bstrGuid, &Guid2);

		_ASSERTE(IsEqualGUID(Guid, Guid2));

		SysFreeString(bstrGuid);
		SysFreeString(bstrGuid32);
	}
	return 0;
}
Ejemplo n.º 5
0
static BOOL GetIIDFromString( IID *iid, char *ps, bool fClsid = false )
{
	//		SJIS文字列 IID から IID 構造体を得る
	//
	//		fClsid が真のとき、ProgID からの CLSID 取得を試みる
	//		ProgID の変換に失敗した場合は FALSE を返す
	//		(それ以外のエラーはエラーを throw)
	//
	HRESULT hr;
	cnvwstr( hspctx->stmp, ps, HSPCTX_REFSTR_MAX/sizeof(WCHAR)-1 );
	if ( *ps == '{' ) {
		// GUID 文字列 → GUID 構造体
		hr = IIDFromString( (LPOLESTR)hspctx->stmp, iid );
		if ( SUCCEEDED(hr) ) return TRUE;
	}
	if ( fClsid ) {
		// ProgID 文字列 → GUID 構造体
		hr = CLSIDFromProgID( (LPOLESTR)hspctx->stmp, iid );
		if ( SUCCEEDED(hr) ) return TRUE;
		return FALSE;
	}
	throw ( HSPERR_ILLEGAL_FUNCTION );
	return FALSE;
}
Ejemplo n.º 6
0
VOID
WINAPI
StreamingDeviceSetupW(IN HWND hwnd, 
                     IN HINSTANCE hinst, 
                     IN LPWSTR lpszCmdLine, 
                     IN int nCmdShow)
{
    DWORD Length, dwResult;
    LPWSTR pCmdLine;
    LPWSTR pStr; 
    GUID Guids[2];
    WCHAR DevicePath[MAX_PATH];
    HRESULT hResult;
    DWORD Index;

    Length = (wcslen(lpszCmdLine) + 1) * sizeof(WCHAR);

    pCmdLine = (LPWSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Length);
    if (pCmdLine == NULL)
    {
        // no memory
        return;
    }

    hResult = StringCbCopyExW(pCmdLine, Length, lpszCmdLine, NULL, NULL, STRSAFE_NULL_ON_FAILURE);
    if (hResult != S_OK)
    {
        // failed
        HeapFree(GetProcessHeap(), 0, pCmdLine);
        return;
    }

    pStr = wcstok(pCmdLine, L",\t\"");
    Index = 0;
    do
    {
        if (pStr == NULL)
        {
            // invalid parameter
            HeapFree(GetProcessHeap(), 0, pCmdLine);
            return;
        }

        hResult = IIDFromString(pStr, &Guids[Index]);
        if (hResult != S_OK)
        {
            // invalid parameter
            HeapFree(GetProcessHeap(), 0, pCmdLine);
            return;
        }

        Index++;
        pStr = wcstok(NULL, L",\t\"");


    }while(Index < 2);


    dwResult = InstallSoftwareDeviceInterface(&Guids[0], &Guids[1], pStr);
    if (dwResult == ERROR_SUCCESS)
    {
        pStr = wcstok(NULL, L",\t\"");
        if (pStr != NULL)
        {
            wcscpy(DevicePath, pStr);
            pStr = wcstok(NULL, L",\t\"");
            if (pStr != NULL)
            {
                dwResult = InstallSoftwareDeviceInterfaceInf(DevicePath, pStr);
            }
        }
    }
}
Ejemplo n.º 7
0
STDMETHODIMP C_Items::Retrieve(I_Archive * arc)
{
	if (!arc)
		return E_POINTER;

	C_STLException::install();

	//TODO - templatize this function and stick it in a base class.
	try {

		BSTR bs = NULL;
		unsigned int len = 0;

		if (S_OK != arc->RetrieveString(&bs)) {
			return E_FAIL;
		}

		String s(bs);
		s.toLower();
		String::FreeBSTR(&bs);

		static String tags[5] = {
			_T("mmp:item"),
			_T("mmp:text"),
			_T("mmp:node"),
			_T("mmp:picture"),
			_T("mmp:branch")
		};

		typedef enum ematches {
			plainitem,
			text,
			node,
			picture,
			branch
		};

		static String types[4] = {
			_T("node"),
			_T("text-block"),
			_T("picture"),
			_T("branch")
		};

		ematches match = plainitem;

		CLSID clsid;
		IID iid;

		StringPtr ptr(s.Find(tags[plainitem]));
		StringPtr ptrKill(s.Find(tags[plainitem]));

		for (unsigned int test = plainitem; test <= branch; test++) {

			ptr = s.Find(tags[test]);

			if (ptr.isValid()) {

				ptrKill = s.Find(String(_T("/")) + tags[test]);
				match = static_cast<ematches>(test);

				break;
			}
		}

		switch (match) {
		case node:
			clsid = CLSID_Node;
			iid = IID_I_Node;
			break;
		case text:
			clsid = CLSID_TextBlock;
			iid = IID_I_TextBlock;
			break;
		case picture:
			clsid = CLSID_Picture;
			iid = IID_I_Picture;
			break;
		case branch:
			clsid = CLSID_Branch;
			iid = IID_I_Branch;
			break;
		}

		while (ptr.isValid() && !ptrKill.isValid()) {//Check this is the start of an item...

			C_ItemPtr item;

			/////////////////////////////////////////////////////
			//	In a paste operation, the object's GUID must be ignored
			//	- a new object is being created with its own identity.
			BOOL b = FALSE;
			BOOL bPreserveID = TRUE;
			BSTR bs = NULL;

			arc->get_PreserveIdentities(&bPreserveID);

			if (bPreserveID) {

				/////////////////////////////////////////////////////
				//	Get the GUID to identify the object. Check if it 
				//	exists already - if so, divert the serialisation data
				//	to the existing object and add a reference to the 
				//	Children collection.
				String sUUID;

				StringPtr ptrUUID = s.Find(_T("uuid"));

				if (ptrUUID.isValid()) {

					StringPtr ptrLeft = s.Find(_T("\""), ptrUUID);
					ptrLeft++;

					if (ptrLeft.isValid()) {

						StringPtr ptrRight = s.Find(_T("\""), ptrLeft);

						if (ptrRight.isValid()) {
							sUUID = s.Mid(ptrLeft.Index(), ptrRight.Index() - ptrLeft.Index());
						}
						else {
							sUUID = s.Right(s.GetLength() - ptrLeft.Index());
						}

						T_SafeArray<char> buffer(sUUID.GetLength() + 1);

						::_stprintf(buffer[0], _T("%s\0"), sUUID.toLPCTSTR());

						GUID guid = String(buffer[0]).toGUID();

						map<GUID, I_MapItem*>::iterator it = m_S_Items.find(guid);

						if (it != m_S_Items.end()) {

							//The object with this GUID already exists in the item map
							item = (*it).second;

							_ASSERTE(item);

							if (item) {

								VARIANT v;

								C_UniquePtr unique(item);

								if (unique) {
									unique->get_UID(&bs);
								}

								VariantInit(&v);
								v.vt = VT_BSTR;
								v.bstrVal = bs;

								get_Exists(v, &b);

								if (!b) {

									//	Add the item to the collection
									Add(bs, item);
									b = TRUE;
								}
							}
						}
					}
				}
			}

			if (b) {

				if (bs) {
					String::FreeBSTR(&bs);
				}
			}
			else {

				if (match == plainitem) {

					int type = -1;

					StringPtr ptrType = s.Find(_T("type"));
					String sType;

					if (ptrType.isValid()) {

						StringPtr ptrLeft = s.Find(_T("\""), ptrType);

						if (ptrLeft.isValid()) {

							ptrLeft++;
							StringPtr ptrRight = s.Find(_T("\""), ptrLeft);

							if (ptrRight.isValid()) {
								sType = s.Mid(ptrLeft.Index(), ptrRight.Index() - ptrLeft.Index());
							}
							else {
								sType = s.Right(s.GetLength() - ptrLeft.Index());
							}

							for (int n = 0; n < 4; n++) {

								if (sType == types[n]) {

									type = n;

									switch (type) {
									case 0:
										clsid = CLSID_Node;
										iid = IID_I_Node;
										break;
									case 1:
										clsid = CLSID_TextBlock;
										iid = IID_I_TextBlock;
										break;
									case 2:
										clsid = CLSID_Picture;
										iid = IID_I_Picture;
										break;
									case 3:
										clsid = CLSID_Branch;
										iid = IID_I_Branch;
										break;
									}

									break;
								}
							}
						}
					}

					if (type < 0) {

						/////////////////////////////////////////////////////
						//	Get the CLSID and IID to identify the object's type
						String sCLSID;
						StringPtr ptrCLSID = s.Find(_T("clsid"));
						StringPtr ptrLeft = s.Find(_T("\""), ptrCLSID);
						ptrLeft++;
						StringPtr ptrRight = s.Find(_T("\""), ptrLeft);

						if (ptrRight.isValid()) {
							sCLSID = s.Mid(ptrLeft.Index(), ptrRight.Index() - ptrLeft.Index());
						}
						else {
							sCLSID = s.Right(s.GetLength() - ptrLeft.Index());
						}

						bs = sCLSID.toBSTR();
						CLSIDFromString(bs, &clsid);
						String::FreeBSTR(&bs);

						String sIID;
						StringPtr ptrIID = s.Find(_T("iid"));
						ptrLeft = s.Find(_T("\""), ptrIID);
						ptrLeft++;
						ptrRight = s.Find(_T("\""), ptrLeft);

						if (ptrRight.isValid()) {
							sIID = s.Mid(ptrLeft.Index(), ptrRight.Index() - ptrLeft.Index());
						}
						else {
							sIID = s.Right(s.GetLength() - ptrLeft.Index());
						}

						bs = sIID.toBSTR();
						IIDFromString(bs, &iid);
						String::FreeBSTR(&bs);
					}
				}

				//	TODO: Drop the string parameter
				item = NewItem(clsid, iid, String(_T("")));
			}

			if (item) {

				arc->Rollback();

				C_PersistentPtr persist(item);

				if (persist) {

					persist->Serialise(arc);

					C_DrawingStrategyPtr strategy(item);

					if (strategy) {
						strategy->putref_Parent(m_pParent);
					}

					BOOL bHasFocus = FALSE;

					item->get_HasFocus(&bHasFocus);

					if (bHasFocus) {

						I_ECBDiagram *map = NULL;

						if (m_pParent) {
							m_pParent->get_Map(&map);
						}

						if (map) {

							map->putref_CurrentSelection(item);
							map->Release();
						}
					}
				}
			}

			if (match == plainitem) {

				//	Discard closing tag
				if (S_OK != arc->RetrieveString(&bs)) {
					return E_FAIL;
				}

				s = bs;
				String::FreeBSTR(&bs);

				s = s.toLower();
				ptr = s.Find(tags[match]);
				ptrKill = s.Find(String(_T("/")) + tags[match]);
			}
			else {
				break;
			}
		}

		if (match == plainitem && !ptrKill.isValid()) {

			//...if it isn't, it doesn't belong here!
			arc->Rollback();
		}

		//	Sort the items as soon as they're retrieved
		Sort();
	}
	catch (C_STLNonStackException const &exception) {
		exception.Log(_T("Exception in C_Items::Retrieve"));
	}

	return S_OK;
}
Ejemplo n.º 8
0
Archivo: comobj.c Proyecto: tuian/UACME
/*
* CopEnumInterfaces
*
* Purpose:
*
* Remember list of available interfaces, excluding IUnknown.
*
*/
BOOL CopEnumInterfaces(
    _In_ INTERFACE_INFO_LIST *InterfaceList
)
{
    BOOL        bResult = FALSE;
    HKEY        hKey = NULL;
    LRESULT     lRet;
    RPC_STATUS  RpcStatus = 0;
    LPWSTR      lpKeyName = NULL;
    SIZE_T      k;
    DWORD       i, cSubKeys = 0, cMaxLength = 0, cchKey;
    IID         iid;

    INTERFACE_INFO *infoBuffer;

    __try {

        lRet = RegOpenKeyEx(HKEY_CLASSES_ROOT, TEXT("Interface"), 0, KEY_READ, &hKey);
        if (lRet != ERROR_SUCCESS)
            __leave;

        lRet = RegQueryInfoKey(hKey, NULL, NULL, NULL, &cSubKeys, &cMaxLength, NULL,
            NULL, NULL, NULL, NULL, NULL);
        if ((lRet != ERROR_SUCCESS) || (cSubKeys == 0))
            __leave;

        infoBuffer = (INTERFACE_INFO*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cSubKeys * sizeof(INTERFACE_INFO));
        if (infoBuffer == NULL)
            __leave;

        cMaxLength = (DWORD)((cMaxLength + 1) * sizeof(WCHAR));
        lpKeyName = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cMaxLength);
        if (lpKeyName == NULL)
            __leave;

        for (k = 0, i = 0; i < cSubKeys; i++) {

            cchKey = (DWORD)(cMaxLength / sizeof(WCHAR));
            if (RegEnumKeyEx(hKey, i, lpKeyName, &cchKey, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {

                if (IIDFromString(lpKeyName, &iid) == S_OK) {

                    //skip IUnknown
                    if (UuidCompare((UUID*)&iid, (UUID*)&IID_IUnknown, &RpcStatus) == 0)
                        continue;

                    cchKey = MAX_PATH * sizeof(WCHAR);
                    infoBuffer[k].iid = iid;

                    RegGetValue(hKey, lpKeyName, TEXT(""), RRF_RT_REG_SZ, NULL,
                        (LPWSTR)&infoBuffer[k].szInterfaceName, &cchKey);

                    k++;
                }
            }
        }
        InterfaceList->cEntries = (ULONG)k;
        InterfaceList->List = infoBuffer;
        bResult = TRUE;
    }
    __finally {
        if (hKey)
            RegCloseKey(hKey);

        if (lpKeyName)
            HeapFree(GetProcessHeap(), 0, lpKeyName);
    }

    return bResult;
}
Ejemplo n.º 9
0
HRESULT CeeFileGenWriter::setLibraryGuid(LPWSTR libraryGuid)
{
    return IIDFromString(libraryGuid, &m_libraryGuid);
} // HRESULT CeeFileGenWriter::setLibraryGuid()
Ejemplo n.º 10
0
bool MiniPlayer::prepare(LPCTSTR filename)
{
	if(fail()) return false;

	HRESULT hr = _mediaCtrl->Stop();

	IBaseFilter *pFileSrc = NULL;
	
	hr = _filterGraph->FindFilterByName(L"Media File", &pFileSrc);
	if(hr == S_OK)
	{
		hr = _filterGraph->RemoveFilter(pFileSrc);
		IF_REL(pFileSrc);
	}

	hr = _filterGraph->AddSourceFilter(filename, L"Media File", &pFileSrc);
	IF_CHK(hr, _T("Unable to add Source Filter for file: %s"), filename);

	IPin *pFileOutputPin = NULL;

	hr = findPin(pFileSrc, PINDIR_OUTPUT, &pFileOutputPin);
	IF_CHK(hr, "Unable to find output pin of File Source Filter.");

	hr = _filterGraph->Connect(pFileOutputPin, _splitterInputPin);
	IF_CHK(hr, "Unable to connect File Source Output Pin & Splitter Input Pin");

	IPin *pSplitterVideoOutputPin = NULL;
	IPin *pSplitterAudioOutputPin = NULL;
	IPin *pVideoDecoderOutputPin = NULL;
	IPin *pAudioDecoderOutputPin = NULL;

	//listAllPins(_splitter);
	hr = findPin(_splitter, PINDIR_OUTPUT, MEDIATYPE_Video, &pSplitterVideoOutputPin);
	if(hr == S_OK)
	{
		hr = _filterGraph->Connect(pSplitterVideoOutputPin, _videoDecoderInputPin);
	}

	hr = findPin(_splitter, PINDIR_OUTPUT, MEDIATYPE_Audio, &pSplitterAudioOutputPin);
	if(hr == S_OK)
	{
		hr = _filterGraph->Connect(pSplitterAudioOutputPin, _audioDecoderInputPin);
	}

	//listAllPins(_videoDecoder);
	hr = findPin(_videoDecoder, PINDIR_OUTPUT, &pVideoDecoderOutputPin);
	if(hr == S_OK)
	{
		hr = _filterGraph->Render(pVideoDecoderOutputPin);
	}

	//listAllPins(_audioDecoder);
	hr = findPin(_audioDecoder, PINDIR_OUTPUT, &pAudioDecoderOutputPin);
	if(hr == S_OK)
	{
		hr = _filterGraph->Render(pAudioDecoderOutputPin);
	}

	IID IID_ITrackInfo;
	IIDFromString(L"{03E98D51-DDE7-43aa-B70C-42EF84A3A23D}", &IID_ITrackInfo);
	ITrackInfo *pTrackInfo;
	hr = _splitter->QueryInterface(IID_ITrackInfo, (void **)&pTrackInfo);

	IAMStreamSelect *pAudioSel;
	hr = _splitter->QueryInterface(IID_IAMStreamSelect, (void **)&pAudioSel);

	hr = pAudioSel->Enable(2, AMSTREAMSELECTENABLE_ENABLE);

	ctrace("Track Info:\n");
	ctrace("  Track Count: %d\n", pTrackInfo->GetTrackCount());
	for(UINT i = 0; i < pTrackInfo->GetTrackCount(); i++)
	{
		TrackElement elem;
		TrackExtendedInfoVideo videoInfo;
		TrackExtendedInfoAudio audioInfo;
		pTrackInfo->GetTrackInfo(i, &elem);
		ctrace("\t [%d] ", i);
		switch(elem.Type)
		{
		case TypeVideo:
			pTrackInfo->GetTrackExtendedInfo(i, &videoInfo);
			ctrace("Video %dx%d", videoInfo.PixelWidth, videoInfo.PixelHeight);
			break;
		case TypeAudio:
			pTrackInfo->GetTrackExtendedInfo(i, &audioInfo);
			ctrace("Audio %d Channels", audioInfo.Channels);
			break;
		case TypeSubtitle:
			ctrace("Subtitle ");
			break;
		}
		ctrace("\n");
	}

	_fail = false;
	return true;

Cleanup:

	return (_fail = true);
}
Ejemplo n.º 11
0
BOOL GetIIDForName(LPCWSTR lpName, IID* riid)
{
	HKEY hRoot = nullptr;
	ULONG status;

	status = RegOpenKeyEx(HKEY_CLASSES_ROOT, L"Interface", 0, KEY_ENUMERATE_SUB_KEYS, &hRoot);
	if (status == 0)
	{
		WCHAR keyName[128];
		DWORD index = 0;
		BOOL foundKey = FALSE;

		while (true)
		{
			HKEY hSubKey;

			status = RegEnumKeyW(hRoot, index, keyName, _countof(keyName));
			if (status != 0)
			{
				break;
			}

			index++;

			status = RegOpenKeyEx(hRoot, keyName, 0, KEY_QUERY_VALUE, &hSubKey);
			if (status != 0)
			{
				continue;
			}

			DWORD dwType;
			WCHAR valueName[256];
			DWORD dwSize = sizeof(valueName)-sizeof(WCHAR);

			status = RegQueryValueEx(hSubKey, nullptr, nullptr, &dwType, (BYTE*)valueName, &dwSize);
			RegCloseKey(hSubKey);

			if ((status != 0) || (dwType != REG_SZ))
			{
				continue;
			}

			// Ensure NUL terminate
			valueName[dwSize / sizeof(WCHAR)] = 0;

			if (_wcsicmp(valueName, lpName) == 0)
			{
				foundKey = TRUE;
				break;
			}
		}

		RegCloseKey(hRoot);

		if (foundKey)
		{
			return SUCCEEDED(IIDFromString(keyName, riid));
		}
	}
	else
	{
		DebugPrintf("Could not open Interface key %d\n", status);
	}

	return FALSE;
}
Ejemplo n.º 12
0
		void MicromassRawData::InitializeForV4()
		{
	#ifdef MASSLYNX_4_INSTALLED
			CLSID clsid ; 
			IID riid ;
			HRESULT res ; 
			
			// DACHeader		
			res =  CLSIDFromString(L"{111A3111-8A5C-11D5-809C-00508B5FFEC8}", &clsid ); 	
			if (res ==REGDB_E_WRITEREGDB)
			{
				throw "Unable to instantiate MassLynx objects: IDACHeader from DacServer.dll . Please install MassLynxV4 on this computer or convert file to MZXml file format using MassWolf on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}
			res = IIDFromString(L"{111A3110-8A5C-11D5-809C-00508B5FFEC8}", &riid) ; 
			if (res == E_INVALIDARG)
			{
				throw "Unable to instantiate MassLynx objects: IDACHeader from DacServer.dll . Please install MassLynxV4 on this computer or convert file to MZXml file format using MassWolf on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}
			res = CoCreateInstance(clsid, NULL,CLSCTX_INPROC_SERVER, riid, (void **) &mptr_dac_header);
			if(res != S_OK)
			{
				throw "Unable to instantiate MassLynx objects: IDACHeader from DacServer.dll . Please install MassLynxV4 on this computer or convert file to MZXml file format using MassWolf on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}
		
			// DACSpectrum
			res =  CLSIDFromString(L"{42BAE6E4-3D52-11D5-8043-00508B5FFEC8}", &clsid ); 	
			if (res ==REGDB_E_WRITEREGDB)
			{
				throw "Unable to instantiate MassLynx objects: IDACSpectrum from DacServer.dll . Please install MassLynxV4 on this computer or convert file to MZXml file format using MassWolf on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}
			res = IIDFromString(L"{42BAE6E3-3D52-11D5-8043-00508B5FFEC8}", &riid) ; 
			if (res == E_INVALIDARG)
			{
				throw "Unable to instantiate MassLynx objects: IDACSpectrum from DacServer.dll . Please install MassLynxV4 on this computer or convert file to MZXml file format using MassWolf on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}
			res = CoCreateInstance(clsid, NULL,CLSCTX_INPROC_SERVER, riid, (void **) &mptr_dac_spectrum);
			if(res != S_OK)
			{
				throw "Unable to instantiate MassLynx objects: IDACSpectrum from DacServer.dll . Please install MassLynxV4 on this computer or convert file to MZXml file format using MassWolf on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}

			// DACScanStats
			res =  CLSIDFromString(L"{0D0678C2-3A1B-11D5-8040-00508B5FFEC8}", &clsid ); 	
			if (res ==REGDB_E_WRITEREGDB)
			{
				throw "Unable to instantiate MassLynx objects: IDACScanStats from DacServer.dll . Please install MassLynxV4 on this computer or convert file to MZXml file format using MassWolf on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}
			res = IIDFromString(L"{0D0678C1-3A1B-11D5-8040-00508B5FFEC8}", &riid) ; 
			if (res == E_INVALIDARG)
			{
				throw "Unable to instantiate MassLynx objects: IDACScanStats from DacServer.dll . Please install MassLynxV4 on this computer or convert file to MZXml file format using MassWolf on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}
			res = CoCreateInstance(clsid, NULL,CLSCTX_INPROC_SERVER, riid, (void **) &mptr_dac_scan_stat);
			if(res != S_OK)
			{
				throw "Unable to instantiate MassLynx objects: IDACScanStats from DacServer.dll . Please install MassLynxV4 on this computer or convert file to MZXml file format using MassWolf on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}

			// DACFunctionInfo
			res =  CLSIDFromString(L"{63E4A0C2-5684-11D5-8063-00508B5FFEC8}", &clsid ); 	
			if (res ==REGDB_E_WRITEREGDB)
			{
				throw "Unable to instantiate MassLynx objects: IDACFunctionInfo from DacServer.dll . Please install MassLynxV4 on this computer or convert file to MZXml file format using MassWolf on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}
			res = IIDFromString(L"{63E4A0C1-5684-11D5-8063-00508B5FFEC8}", &riid) ; 
			if (res == E_INVALIDARG)
			{
				throw "Unable to instantiate MassLynx objects: IDACFunctionInfo from DacServer.dll . Please install MassLynxV4 on this computer or convert file to MZXml file format using MassWolf on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}
			res = CoCreateInstance(clsid, NULL,CLSCTX_INPROC_SERVER, riid, (void **) &mptr_dac_func_info);
			if(res != S_OK)
			{
				throw "Unable to instantiate MassLynx objects: IDACFunctionInfo from DacServer.dll . Please install MassLynxV4 on this computer or convert file to MZXml file format using MassWolf on http://sashimi.sourceforge.net/software_glossolalia.html." ;
			}
	#endif 
		}
Ejemplo n.º 13
0
void CRTFReaderTHDDlg::OnRead() 
{
#ifndef _DEBUG
	try
#endif
	{
		UpdateData(TRUE);
		EnableReaders(false);

		IWSRTFFile* pFile1 = NULL;

		USES_CONVERSION;
		IID iidRtfFile;
		IIDFromString(T2W(_T("{") _T(_IID_IWSRTFFile) _T("}")), &iidRtfFile);

		CLSID clsidRtfFile;
		CLSIDFromProgID(T2W(_T(_PROGID_WSRTFFile)), &clsidRtfFile);
		HRESULT hr=CoCreateInstance(clsidRtfFile,NULL,CLSCTX_INPROC_SERVER,iidRtfFile, reinterpret_cast<void**> (&pFile1));

		if (SUCCEEDED(hr))
		{
			BOOL bRes = CopyFile(LPCTSTR(m_csFile1), CString(CGeneral::GetTemporaryPath().c_str()) + _T("\\RTFIn1.rtf"), false);
			bRes = CopyFile(LPCTSTR(m_csFile1), CString(CGeneral::GetTemporaryPath().c_str()) + _T("\\RTFIn1.txt"), false);

			pFile1->InputFileName=_bstr_t(m_csFile1);
			pFile1->OutputFileName=_bstr_t(CString(CGeneral::GetTemporaryPath().c_str())+_T("\\RTFOut1.rtf"));



//			pFile1->put_InputFileName(_bstr_t(m_csFile1));
//			pFile1->put_OutputFileName(_bstr_t());

			pFile1->ReadFile();

			pFile1->WriteFile();

			pFile1->Release();

			bRes=CopyFile(CString(CGeneral::GetTemporaryPath().c_str())+_T("\\RTFOut1.rtf"),CString(CGeneral::GetTemporaryPath().c_str())+_T("\\RTFOut1.txt"),false);

		}
		else
			AfxMessageBox(_T("Cannot Create  WSCompose3.WSRTFFile Object"), MB_OK | MB_ICONSTOP);

/*
		RTFfile f, g;


		ERTFToken ec = f.ReadFile(LPCTSTR(m_csFile1));
		ec = f.WriteFile(CString(CGeneral::GetTemporaryPath().c_str()) + "\\RTFOut1.txt");
		CopyFile(CString(CGeneral::GetTemporaryPath().c_str()) + "\\RTFOut1.txt", CString(CGeneral::GetTemporaryPath().c_str()) + "\\RTFOut1.rtf", false);		
		
		if(m_bMerge)
		{
			bRes = CopyFile(LPCTSTR(m_csFile2), CString(CGeneral::GetTemporaryPath().c_str()) + "\\RTFIn2.rtf", false);
		    bRes = CopyFile(LPCTSTR(m_csFile2), CString(CGeneral::GetTemporaryPath().c_str()) + "\\RTFIn2.txt", false);

			ec = g.ReadFile(m_csFile2);

			g.WriteFile(CString(CGeneral::GetTemporaryPath().c_str()) + "\\RTFOut2.txt");
			CopyFile(CString(CGeneral::GetTemporaryPath().c_str()) + "\\RTFOut2.txt", CString(CGeneral::GetTemporaryPath().c_str()) + "\\RTFOut2.rtf", false);
			
			f.MergeResources(&g);

			f.WriteFile(CString(CGeneral::GetTemporaryPath().c_str()) + "\\RTFMerged.txt");
			CopyFile(CString(CGeneral::GetTemporaryPath().c_str()) + "\\RTFMerged.txt", CString(CGeneral::GetTemporaryPath().c_str()) + "\\Merged.rtf", false);			
		}

*/
		EnableReaders(true);



	}
#ifndef _DEBUG
	catch(...)
	{
		// Exception thrown
		ASSERT(false);
	}
#endif
//	RTFformatting::ClearStatics();
}