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 469757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:48:59+00:00 2026-05-12T23:48:59+00:00

I have a WPF DLL being called from an unmanaged DLL. The WPF DLL

  • 0

I have a WPF DLL being called from an unmanaged DLL. The WPF DLL has a dialog that has been translated (two sets of .resx files).

If I call the WPF DLL from a WinForm shell, or another WPF shell, I can force the dialog to a particular language (.resx file) by setting the Culture of the current thread.

However, when calling the WPF DLL (through interop – COM) from the C++ DLL, I can’t get the WPF dialog to switch to any language other than the default.

I don’t necessarily need to read the current system culture, because the unmanaged DLL does it differently. I would like to tell the WPF DLL what language to use when I run it.

How can I force it to load with a particular language at runtime?

  • 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-05-12T23:48:59+00:00Added an answer on May 12, 2026 at 11:48 pm

    Something to try:

    Set the culture and create the dialog in a single call, like this:

    // Managed code
    void SetCultureAndShowWindow(CultureInfo culture, ... more parameters for creating window ...)
    {
      Thread.CurrentThread.CurrentCulture = culture;
      Window window = new Window(...
      window.ShowDialog();
    }
    

    When calling from C++ through interop, NET Framework must bind your native thread to a NET Framework thread. I don’t remember the details, but I remember something about a mechanism where NET Framework threads are reused and garbage collected. If you are making a call to managed code that is setting the culture and a second call to create the window, a possible scenario is:

    1. You call the managed code to set the culture.
    2. A new managed thread is created
    3. Your call returns, and the managed thread is released.
    4. You call the managed code to create and show the window.
    5. A new managed thread is created
    6. The window shows with the wrong culture

    Such a sequence of events is conceivable, depending on the implementation of the mangaged-native thread binding code. Therefore I suggest you try doing both in a single call to see if it changes anything.

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

Sidebar

Related Questions

I have a WPF click-once application that makes use of an unmanaged dll. When
I have a WPF project (creating dll). The text boxes that added, (or the
I have a WPF windows application that makes a call to a DLL for
I have a WPF project, and there is one dialog that I will re-use
I have a BaseSkin and multiple UserSkins in a separate dll from my WPF
Context: I have a WPF App that uses certain unmanaged DLLs in the D:\WordAutomation\MyApp_Source\Executables\MyApp
I have a WPF dll that contains a number of Window classes and exposes
In my WPF project, I have a dll that contains several WPF UserControls. I
I have a WPF application that has a variable x which is an instance
I have a WPF application (KaleidoscopeApplication) organized as follows: Solution (6 projects) Cryptography (DLL)

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.