Skip to content

GetErrorString produces garbage when faces an unknown error code #10

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Use GetErrorString to have detailed error message
2. Send some unknown parameter to the function
3. result will be some boxes and garbage characters

What is the expected output? What do you see instead?
The output should be the error message, or, when there is no predefined 
message, return "unknown error" instead of garbage.

What version of the product are you using? On what operating system?
I am using WinXP, Delphi XE2

Please provide any additional information below.
Function could be like this:
  function GetErrorString(hr: HRESULT): String;
  var
    buffer: array[0..254] of Char;
    Res: Cardinal;
  begin
    Res := AMGetErrorText(hr, @buffer[0], 255);
    if Res = 0 Then
    Begin
      Result := 'Unknown error'
    End
    Else
      result := buffer;
  end;

Note that there is error checking.
unit DXSUtil;
     *  DSPack 2.3.3                                                     *

Original issue reported on code.google.com by celaler...@gmail.com on 28 Feb 2012 at 11:56

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions