TF_CreateInputProcessorProfiles function

The TF_CreateInputProcessorProfiles function is used to create a input processor profile 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 input processor profile objects be created using CoCreateInstance , as demonstrated in ITfInputProcessorProfiles.

Syntax


HRESULT TF_CreateInputProcessorProfiles(
  _Out_  I TfInputProcessorProfiles **ppipr
);

Parameters

ppipr [out]

Pointer to an ITfInputProcessorProfiles interface pointer that receives the input processor profile object.

Return value

ValueMeaning
S_OKThe function was successful.
E_FAILAn unspecified error occurred.
E_INVALIDARGppipr 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_CREATEINPUTPROCESSORPROFILES)(ITfInputProcessorProfiles**);

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

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

else
{
    PTF_CREATEINPUTPROCESSORPROFILES pfnCreateInputProcessorProfiles;
    
    pfnCreateInputProcessorProfiles = (PTF_CREATEINPUTPROCESSORPROFILES)GetProcAddress(hMSCTF, "TF_CreateInputProcessorProfiles");

    if(pfnCreateInputProcessorProfiles)
    {
        HRESULT hr;
        ITfInputProcessorProfiles *pInputProcessorProfiles;

        hr = (*pfnCreateInputProcessorProfiles)(&pInputProcessorProfiles);
        if(SUCCEEDED(hr))
        {
            pInputProcessorProfiles->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

ITfInputProcessorProfiles

 

 

Community Additions

ADD
Show:
© 2014 Microsoft