How is it right to keep the sixteenth code?



  • I'm opening a picture in my program and getting her 16th code in the text field. Please tell me how to keep the 16th code from this field properly so that the picture comes out. I keep the file, but I don't open, write the wrong file.

    That's how I keep:

    long length = GetWindowTextLength(hwndbytes); //hwndbytes - дескриптор текстового поля с 16 кодом
    TCHAR* data = new TCHAR[length];
    GetWindowText(hwndbytes, data, length + 1);
    WriteFile(hfile, data, 2*lstrlen(data), &writedBytes, NULL);
    CloseHandle(hfile);
    

    Turns out I'm keeping 16 code as a text in a licensed file, but it's not a skate, please tell me what's right or slap your nose!



  • It's not right to keep the code, it's the bikes. Trying to record binary data in the text field and then pull them out through GetWindowText() is not a good idea, especially in TCHAR. The conversion of raw baths into text and back is likely to distort data, which is why you have a broken file.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2