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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:25:13+00:00 2026-05-27T15:25:13+00:00

i am working on making my applications international. After two days digging on msdn

  • 0

i am working on making my applications international. After two days digging on msdn i came up with a test, which loads language-specific library containing resources. This is also my first attempt at loading library as a resource, loading strings from it and so on.

Next, according to msdn example at http://msdn.microsoft.com/en-us/library/windows/desktop/dd319071%28v=VS.85%29.aspx, i’m trying the LoadString.

Since string loading for entire application equals a lot of text copying, i thought i would use the – what i think is – memory efficient feature of LoadString, which is setting nBufferMax parameter to zero. According LoadString documentation, it should return a pointer to string resource. I thought i’d make a struct or a class of string pointers and do something along these lines (i extracted only the important bits):

wchar_t textBuf[SOMEVALUE]; // <-- this is how id DOES work
wchar_t *myString; // <-- this is how i would like it
HMODULE resContainer=LoadLibraryEx(L"MUILibENU.dll",NULL, LOAD_LIBRARY_AS_DATAFILE);
if(0!=resContainer){
  // this works OK
  int copied=LoadStringW(resContainer,IDS_APP_TITLE,textBuf,SOMEVALUE); 
  // this fails, also gives a warning at compile time about uninitialized variable used.
  int copied=LoadStringW(resContainer,IDS_APP_TITLE,myString,0);
}

As you can see i am trying to get myString to become a pointer to loaded resource library’s string without actually copying anything.
My question is: am i misunderstanding msdn documentation? Can i or can i not get a pointer to the string directly within loaded library, and simply use it later, e.g. to show a messagebox, without actually copying anything? Until i unload said library?

  • 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-27T15:25:13+00:00Added an answer on May 27, 2026 at 3:25 pm

    MSDN says:

    […] If this parameter is 0, then lpBuffer receives a read-only pointer to the resource itself.

    It means that a) the pointer must be of type const wchar_t*:

    const wchar_t *myString;
    

    and b) you must pass a pointer to the pointer and use an ugly cast:

    int copied=LoadStringW(resContainer,IDS_APP_TITLE,(LPWSTR)&myString,0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on making a simple server application with python, and I'm trying to
I'm working on making 3 VM versions of XP with IE6, 7, and 8
I'm working on making an ASCII based game, and everywhere I look people are
I am working on making a new SQLite database. Obviously for a number of
I am working on making a simple drawing program. So far I am able
At my current job I've been working on making web apps with Java, Tapestry,
Hi im making a custom Textbox i got everty thing working but how do
We're making this web app in PHP and when working in the reports we
I'm working on a web page where I'm making an AJAX call that returns
I'm working with some example java code for making md5 hashes. One part converts

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.