One inportant issue first:
Always use PWideChar or PAnsiChar in
DLL interfaces. Otherwise it depends on the Delphi version and what PChar means in it whether your program works or not...
Regarding your problem:
I don't see an error handling (you ignore the return value). And where does the
exception occur? Inside the
DLL function?
And could you please post the source of the function inside the
DLL too?