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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:50:14+00:00 2026-05-31T19:50:14+00:00

First, please forgive my bad english ;) I want to use the windows function

  • 0

First, please forgive my bad english 😉

I want to use the windows function ToUnicode (http://msdn.microsoft.com/en-us/library/windows/desktop/ms646320(v=vs.85).aspx) to convert a virtual key code into an unicode char with C++.
But everytime I call that function, Windows7 says “MyProcess funktioniert nicht mehr” – I don´t know the english eqiuvalent, perhaps it´s “MyProcess does not work any more”?! – and I have the choice to debug MyProcess or to Close.

However my gdb debugger shows that I get a SIGSEGV, which tells me there is a data access violation I think.

This is the code I use:

BYTE kbd[256];
GetKeyboardState(kbd);
UINT vk = 65;   //vitual key represents 'a'
UINT sc = 30;    //scan code represents 'a'
LPWSTR chars;

ToUnicode(vk,sc,kbd,chars,2,0);

I even tried the ToAscii function and i get the same error : SIGSEGV

Can you please help me? =)

  • 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-31T19:50:16+00:00Added an answer on May 31, 2026 at 7:50 pm

    ToUnicode expects a buffer where it can write the translation result to.

    You give it an unitialized pointer pointing somewhere (random) in your memory – this is where the segfault is coming from, ToUnicode tries to write to memory which doesn’t belong to your process.

    See the following example for correct usage of this function

    //Just a snippet showing the initialization the buffer part    
    const int BUFFER_LENGTH = 2; //Length of the buffer
    WCHAR chars[BUFFER_LENGTH];
    
    ToUnicode(vk,sc,kbd,chars,BUFFER_LENGTH,0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first post, and first please forgive me for my poor english.
First, please forgive me for my approximative English. I have 2 tables, one (tb_facture)
I am struggling with a problem - please forgive me for my bad English.
first, please forgive my ignorance and inability so use the search engine (i swear
First of all, please forgive me if I use the wrong terminology or I
First, please forgive and point out if I am to use some other protocol
I'm putting my django site in production for the first time so please forgive
I have code like that 010200345 i want split every first three digit please
First please forgive me for total lack of understanding of Varnish. This is my
This is my first post, so please forgive me if this question has been

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.