* * *

Author Topic: runtime Error 740  (Read 1363 times)

cpicanco

  • Full Member
  • ***
  • Posts: 229
    • My Portfolio
runtime Error 740
« on: December 17, 2016, 03:37:44 pm »
On windows 10, after succefully compiling a program, the debugger exits with a runtime error 740.

There is an error message that reads "Error 740: The requested operation requires elevation", but this message was not shown, only the number was shown. 

Running the program outside Lazarus gives the error message : "A referral was returned from the server".

Just right clicking and selecting Open as admin does not work. 

I solved the problem by right clicking at the executable, selecting properties and checking the box "Run as administrator". In Lazarus, project options, the item "Require administrator" was selected in the "Execution level" combo box. Error 740 persists when "as invoker" item was selected. Error 740 persists when running Lazarus as admin (just by right clicking and selecting open as admin, no checkbox...).

I am guessing that I am missing something here because the program does not requires admin privilegies. It requires only network access (libzmq.dll, with 14.0 vs toolkit, is a dependency).

So how to properly solve this issue?

Thaddy

  • Hero Member
  • *****
  • Posts: 3971
Re: runtime Error 740
« Reply #1 on: December 17, 2016, 04:53:58 pm »
You need to define a rule for the windows firewall.
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

cpicanco

  • Full Member
  • ***
  • Posts: 229
    • My Portfolio
Re: runtime Error 740
« Reply #2 on: December 17, 2016, 06:10:05 pm »
Yes, I did setup a firewall rule. Error 740 persists without checking the "run as admin" checkbox.

Thaddy

  • Hero Member
  • *****
  • Posts: 3971
Re: runtime Error 740
« Reply #3 on: December 18, 2016, 08:03:30 am »
Yes, I did setup a firewall rule. Error 740 persists without checking the "run as admin" checkbox.
In that case:
Did you include a manifest resource? In that you can request elevation.
https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/aa374191(v=vs.85).aspx

If the user has sufficient rights on the network, then the privilege level should probably be "AsInvoker".
The application will then inherit the rights of the user.
« Last Edit: December 18, 2016, 12:15:57 pm by Thaddy »
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

cpicanco

  • Full Member
  • ***
  • Posts: 229
    • My Portfolio
Re: runtime Error 740
« Reply #4 on: December 22, 2016, 03:40:03 pm »
Hi Thaddy, many thanks for your time. Do you know if the project option "Include manifest file to enable themes" is the same manifest you poited out? It was checked and the error persists.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus