Hello everybody,
I am trying to call a DLL created with Delphi 7. It takes one parameter of type String writes it in a textfile and returns nothing. I have designed a very simple VI consisting of a String constant linked to a Call Library Function Node. In the Call Library Function Node I use stdcall Calling Convention and String - Pascal String Pointer as arg1. LabView crashes after the execution, the DLL creates the output file but writes nothing in it.
I have tried about any combination of Calling Convention and argument type in the Call Library Function Node but not one seemed to work. If I pass a double value to the DLL (changing the DLL accordingly...) I have no problems.
This seems to me to be the most basic example of a DLL-call, can any body tell me what I am missing? Thank you very much!
Stefan
The DLL Delphi code:
library UMP_DLL;
uses
SysUtils,
Classes;
procedure UMP_calc(output: String);
var
myFile : TextFile;
begin
AssignFile(myFile,'output.txt');
ReWrite(myFile);
Write(myFile,output);
CloseFile(myFile);
end;
exports
UMP_calc;
begin
end.