Calling AfxEnableMemoryLeakDump for a specific mfc dll
===

We have a visual studio Unicode application where we use some external dlls. In this application mfc100ud.dll is loaded (notice the u, which stands for Unicode). The application also uses some external dlls which are linked with mfc100d.dll (so no Unicode).

In our application I want to disable the memory leak dump which is part of Afx by calling AfxEnableMemoryLeakDump(FALSE). When I call this function I end up in mfc100ud.dll since we directly link with this dll. However later on the external dll is loaded, and hence mfc100d.dll is also loaded.
When the application is closed, mfc100d.dll is unloaded and since AfxEnableMemoryLeakDump wasn't called for this dll, we MemoryLeakDump still happens.

To solve this I tried to explicitly call the function in the dll by doing this:

      PGNSI pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(TEXT("mfc100d.dll")),
           "?AfxEnableMemoryLeakDump@@YGHH@Z"); // 64-bit
      if (pGNSI!=nullptr)
      {
        pGNSI(FALSE);
      }
      pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(TEXT("mfc100d.dll")),
           "?AfxEnableMemoryLeakDump@@YAHH@Z"); // 32-bit
      if (pGNSI!=nullptr)
      {
        pGNSI(FALSE);
      }

I used dumpbin.exe to look up the decorated function names.

But this doesn't work since GetProcAddress returns a nullptr both for 32-bit and 64-bit.
Can somebody help with this?