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:
[5 May 2009 - updated with Siva's comment, but didn't actually try to compile it]
// Declare the stuff to use (repeat for each function/dll to import)
typedef int (__stdcall *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.
Comments
- Anonymous
May 04, 2009
The function pointer declaration is wrong. it should have the __stdcall calling coversion.