Welcome to MSDN Blogs Sign in | Join | Help

IDN Mitigation API dll needs to be explicitly linked

Since we (I) didn't provide a .lib file for the "Microsoft Internationalized Domain Name (IDN) Mitigation APIs 1.0", you'll have to explicitly link to the IDN Mitigation API dll, which means you'll have to make your own header & code something like:

// Declare the stuff to use (repeat for each function/dll to import)
typedef int (*PFN_DOWNLEVELGETLOCALESCRIPTS)
    (LPCWSTR lpLocaleName, LPWSTR lpLCData, int cchData);

PFN_DOWNLEVELGETLOCALESCRIPTSm_pfnGetLocaleScripts = NULL;
HMODULE m_hDownlevelDll = NULL;

...
// Load the library and get our function pointer
m_hDownlevelDll = LoadLibrary(L"idndl.dll");
if (m_hDownlevelDll != NULL)
{
    FARPROC pfn = GetProcAddress(m_hDownlevelDll, "DownlevelGetLocaleScripts");
    if (pfn != NULL)
    {
        m_pfnGetLocaleScripts = (PFN_DOWNLEVELGETLOCALESCRIPTS)pfn;
    }
    // else error
}

// else error
...

// Call the function using our pointer
int count = (*pfnGetLocaleScripts)( L"en-US", NULL, 0 );

Hope that helps, we'll probably add the .lib in a future update, but that'll probably be a while.

Published Thursday, January 05, 2006 9:52 AM by shawnste

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker