Icon View Thread

The following is the text of the current message along with any replies.
Messages 21 to 23 of 23 total
Thread Returning a value from a stored procedure in an external module.
Thu, Jul 24 2014 9:07 AMPermanent Link

Abdulaziz Al-Jasser

Finally I found the problem.  You want believe it (stupid problem).  Here is the story:

Long time back I created a small procedure that I use for debugging.  This procedure by default create and write some texts/values to a file on C drive.  Here is the procedure:

procedure Debug(const sBuffer : WideString);
const
         sFileName : String = 'C:\DEBUG.TXT';
var
         hFile : Textfile;
begin
         AssignFile(hFile, sFileName);

         if FileExists(sFileName) then
           Append(hFile)
         else
           Rewrite(hFile);

         Writeln(hFile, sBuffer);
         CloseFile(hFile);
end;


Example of use:

Debug('I will call the function to get the disk serial no');
sDiskSerialNo := GetServerSerialNo;
Debug('The disk serial no is: ' + sDiskSerialNo);




Now for security reasons Windows8 (which I'm running) do not allow the file to be created on drive C and causes an error which prevent the next line from getting executed.  Therefore, I got Null all the time.  It was very hard to find because the application and the external module (DLL) did not raise/show any errors.  Amazing!!!
Regards,
Abdulaziz Jasser
Thu, Jul 24 2014 9:23 AMPermanent Link

Raul

Team Elevate Team Elevate

On 7/24/2014 9:07 AM, Abdulaziz Jasser wrote:
> Now for security reasons Windows8 (which I'm running) do not allow the file to be created on drive C and causes an error which prevent the next line from getting executed.  Therefore, I got Null all the time.  It was very hard to find because the application and the external module (DLL) did not raise/show any errors.  Amazing!!!

Good you found it.

External module did not raise any errors because i/o checking is
normally not enabled (so no exception) and your code is not checking for
failures either (assuming your code is similar to what you listed).

You need to check IOResult after every operation yourself if you use
legacy fil i/o operations (i.e. if IOResult = 0 then ... after
append/rewrite and writeln etc).

Root of C permissions (and program files and windows OS folders) etc
changed in Vista so AFAIK this is not new to Win 8.

Raul
Thu, Jul 24 2014 9:56 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Abdulaziz


And it wasn't in the demo which is why it worked here Smile

Roy Lambert
« Previous PagePage 3 of 3
Jump to Page:  1 2 3
Image