CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11

Threaded View

  1. #1
    Join Date
    May 2012
    Posts
    43

    Reading string out of embedded resources

    Hello,

    I am using the Embedded resources to store a string.
    The client is in C# and is putting the string on a C++ program.

    When the C++ program gets opened, it reads the string.

    But there is a small problem. Once it reads the string, It only picks the first Character.

    Like if I store "Hello" in the resources. The messagebox only shows "H"

    Code:
        HRSRC hRsrc3 = FindResource(0, "5", "RT_RCDATA"); //RT_RCDATA
        HGLOBAL hGlobal3 = LoadResource(0, hRsrc3);
        LPCSTR messs = (LPCSTR)LockResource(hGlobal3);
    
        MessageBox(NULL, messs, "bonjour(s)", MB_OK);
    I tried wchar_t, char* and LPCSTR, all give the same result.

    Thanks in advance.
    Last edited by qwerz; June 10th, 2012 at 06:41 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured