TF_CreateLangBarMgr function

The TF_CreateLangBarMgr function creates a language bar manager object without having to initialize COM. Usage of this method is not recommended, because the calling process must maintain a proper reference count on an object that is owned by Msctf.dll.

It is instead recommended that language bar manager objects be created using CoCreateInstance , as demonstrated in ITfLangBarMgr.

Syntax


HRESULT TF_CreateLangBarMgr(
  _Out_  ITfLangBarMgr **pppbm
);

Parameters

pppbm [out]

Pointer to an ITfLangBarMgr interface pointer that receives the language bar manager object.

Return value

ValueMeaning
S_OKThe function was successful.
E_FAILAn unspecified error occurred.
E_INVALIDARGpppbm is invalid.

 

Examples

There is no import library available that defines this function, so it is necessary to manually obtain a pointer to this function using LoadLibrary and GetProcAddress. The following code example demonstrates how to accomplish this.

Note  

Using LoadLibrary incorrectly can compromise the security of your application by loading the wrong DLL. Refer to the LoadLibrary documentation for information on how to correctly load DLLs with different versions of Windows.



typedef HRESULT (WINAPI *PTF_CREATELANGBARMGR)(ITfLangBarMgr**);

HMODULE hMSCTF = LoadLibrary(TEXT("msctf.dll"));

if(hMSCTF == NULL)
{
    //Error loading module -- fail as securely as possible 
}

else
{
    PTF_CREATELANGBARMGR pfnCreateLangBarMgr;
    
    pfnCreateLangBarMgr = (PTF_CREATELANGBARMGR)GetProcAddress(hMSCTF, "TF_CreateLangBarMgr");

    if(pfnCreateLangBarMgr)
    {
        HRESULT hr;
        ITfLangBarMgr *pLangBarMgr;

        hr = (*pfnCreateLangBarMgr)(&pLangBarMgr);
        if(SUCCEEDED(hr))
        {
            pLangBarMgr->Release();
        }
    }

    FreeLibrary(hMSCTF);
}


Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Redistributable

TSF 1.0 on Windows 2000 Professional

Header

Msctf.h

DLL

Msctf.dll

See also

CoCreateInstance
GetProcAddress
ITfLangBarMgr
LoadLibrary

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.