次の方法で共有


IVsTextManager.MapFilenameToLanguageSID(String, Guid) Method

Definition

Given a file name, determines the registered language service, if one exists, that understands it.

public:
 int MapFilenameToLanguageSID(System::String ^ pszFileName, [Runtime::InteropServices::Out] Guid % pguidLangSID);
public int MapFilenameToLanguageSID (string pszFileName, out Guid pguidLangSID);
abstract member MapFilenameToLanguageSID : string * Guid -> int
Public Function MapFilenameToLanguageSID (pszFileName As String, ByRef pguidLangSID As Guid) As Integer

Parameters

pszFileName
String

[in] File name associated with the language service.

pguidLangSID
Guid

[out] Pointer to the language service.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From textmgr.idl:

HRESULT IVsTextManager::MapFilenameToLanguageSID(  
   [in] const WCHAR *pszFileName,  
   [out] GUID *pguidLangSID  
);  

This method allows you to map a file type to the appropriate language service for that type. This mapping works by looking in "HKEY_LOCAL_MACHINE\ Software\Microsoft\Languages\File Extensions" for entries that map an extension to a SID, that is, a CLSID for a language service that presumably implements IVsLanguageInfo.

Applies to