TF_CreateLangBarItemMgr function
The TF_CreateLangBarItemMgr function is used to create a language bar item 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 item manager objects be created using CoCreateInstance , as demonstrated in ITfLangBarItemMgr.
Syntax
HRESULT TF_CreateLangBarItemMgr( _Out_ ITfLangBarItemMgr **pplbim );
Parameters
- pplbim [out]
-
Pointer to an ITfLangBarItemMgr interface pointer that receives the language bar item manager object.
Return value
| Value | Meaning |
|---|---|
| S_OK | The function was successful. |
| E_FAIL | An unspecified error occurred. |
| E_INVALIDARG | pplbim 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_CREATELANGBARITEMMGR)(ITfLangBarItemMgr**); HMODULE hMSCTF = LoadLibrary(TEXT("msctf.dll")); if(hMSCTF == NULL) { //Error loading module -- fail as securely as possible } else { PTF_CREATELANGBARITEMMGR pfnCreateLangBarItemMgr; pfnCreateLangBarItemMgr = (PTF_CREATELANGBARITEMMGR)GetProcAddress(hMSCTF, "TF_CreateLangBarItemMgr"); if(pfnCreateLangBarItemMgr) { HRESULT hr; ITfLangBarItemMgr *pLangBarItemMgr; hr = (*pfnCreateLangBarItemMgr)(&pLangBarItemMgr); if(SUCCEEDED(hr)) { pLangBarItemMgr->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 |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 5/16/2013
