Can any one help with this
I am attempting to convert some 'C' to Delphi
Part of the software's function is to read in data from several differently structured files, into associated structures.
I have set up Pascal records with the same format (no problem here).
But the original code contains a function which accepts the name of a structure as a parameter, it is then able to read into this structure without knowing anything about the format. This seems to be done by pssing a void pointer to the structure.
declared as e.g.
readfunction(size ,void *generalstruct, etc)
called with readfunction(sizeof(strucname) (char *)&structname)
A block read of the file is accomplised by also passing in the structure(record) size.
So far I have not found a way to pass such a generic pointer to a Delphi procedure
Does anyone know how to do this in Delphi?
Steve
I am attempting to convert some 'C' to Delphi
Part of the software's function is to read in data from several differently structured files, into associated structures.
I have set up Pascal records with the same format (no problem here).
But the original code contains a function which accepts the name of a structure as a parameter, it is then able to read into this structure without knowing anything about the format. This seems to be done by pssing a void pointer to the structure.
declared as e.g.
readfunction(size ,void *generalstruct, etc)
called with readfunction(sizeof(strucname) (char *)&structname)
A block read of the file is accomplised by also passing in the structure(record) size.
So far I have not found a way to pass such a generic pointer to a Delphi procedure
Does anyone know how to do this in Delphi?
Steve