Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8778979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:39:48+00:00 2026-06-13T19:39:48+00:00

I am building an existing MFC application with Visual Studio 2012. The application uses

  • 0

I am building an existing MFC application with Visual Studio 2012. The application uses "RichEdit20A" controls and custom controls which inherit CRichEditCtrl.

During InitInstance() the application calls ::AfxInitRichEdit2(), which calls AtlLoadSystemLibraryUsingFullPath(L"RICHED20.DLL"), which callsLoadLibraryExW(pszLibrary, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32). The latter call fails and returns NULL. GetLastError() returns 87 (The parameter is incorrect.). This happens on both Win7 x64 and Win8 x64.

The failing call seems to have been introduced in the Visual Studio 2012 runtime (it is inside a conditional #if NTDDI_VERSION >= NTDDI_WIN8). The application worked just fine when built with Visual Studio 2008.

Does anyone know why this happens and how to fix (or work around) this issue? Alternatively, is there any way to “revert” the runtime to use the older load behavior?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:39:49+00:00Added an answer on June 13, 2026 at 7:39 pm

    Choosing the proper target Windows version can be very important. It is here, if you don’t explicitly set it yourself then the Visual Studio assumes you’ll target the latest and greatest. Which is Windows 8 for VS2012.

    Which includes a new option for LoadLibraryEx(), the LOAD_LIBRARY_SEARCH_SYSTEM32 option. Available on Windows 8 but requires a security patch to be installed if you use it on Windows Vista, 7 or 2008. It is a pretty critical one, clearly you don’t have it installed.

    If you want your program to be compatible with old or unpatched Windows versions then you need to change the target. This is typically done by the targetver.h header file, assuming your MFC project was generated by a relatively recent wizard. Modify it like this:

    #pragma once
    
    // Including SDKDDKVer.h defines the highest available Windows platform.
    
    // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
    // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
    
    #define _WIN32_WINNT _WIN32_WINNT_WINXP    // NOTE: added
    #include <SDKDDKVer.h>
    

    If you don’t have targetver.h then put it anywhere before the #include for <windows.h>. Tweak the value as desired. Note that XP isn’t currently supported by VS2012 but will be later.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing web application which I have been building with an ant
I'm building an application that opens existing mail messages in Outlook. The user may
I'm building a small chat application to add to an existing framework. There will
I am building an application heavily relying on XMPP. Apart from using existing protocols
I'm building a .net-microframework app that uses Zeroconf. The existing zeroconf solutions all seem
I am building an application in Excel which will enable a user to select
i'm building a Rails application to extend features of an existing online Rails app.
I'm currently working on building an application in CakePHP. There's a quite extensive existing
I'm building on top of an existing UI which is in Swing. I need
I'm building a custom search page and attempting to use an existing custom search

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.