Hi all,

I've run into a strange problem with a DLL that for the life of me I
can't figure out, and I'm hoping that someone out there can help. I have
a record declared as follows,

type
  TDescriptor = packed record
    ID: PWideChar;
    Name: PWideChar;
    Major: Integer;
    Minor: Integer;
    Flags: Integer;
    Additional: PWideChar;
  end;

I have an exported function from a DLL I've written that is declared as
follows,

function GetDescriptor(ID: PWideChar; var Descriptor: TDescriptor):
Integer;

This function simply looks up the appropriate values based on the ID
parameter, fills in the members of the Descriptor parameter, and returns
an integer value to indicate success or failure. This all works fine for
the most part. The calling application asks for the descriptor for a
given ID and it gets it back with everything correctly filled in. 

However, when the ID is less than 5 characters, it leaves the
GetDescriptor function with the ID member properly set in the Descriptor
parameter, but when it returns to the calling application the ID member
is complete garbage. All other values are correct and ID's longer than 6
characters are fine also. Note that I do not use the ID parameter to
fill in the ID member of the Descriptor parameter.

Does anyone have any ideas?

Regards,
Darren
--
Darren Ferguson
Senior Software Engineer
Clinical Software Division
Medtel Australia
Adelaide, South Australia
 
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to