Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The <a href="http://docwiki.embarcadero.com/Libraries/XE2/en/System.Win.ComObj.CreateOleObject" rel="noreferrer"><code>CreateOleObject</code></a> delphi function internally calls the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms686615%28v=vs.85%29.aspx" rel="noreferrer">CoCreateInstance</a> WinApi method which requires elevation. you have a couple of options to deal with this. </p> <p>1) Adding a manifest to your app including the <a href="http://msdn.microsoft.com/en-us/library/bb756929.aspx" rel="noreferrer">requested execution level</a> <em>requireAdministrator</em>.</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt; &lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&gt; &lt;assemblyIdentity name="Your app name goes here" processorArchitecture="x86" version="5.1.0.0" type="win32"/&gt; &lt;description&gt;your app description goes here&lt;/description&gt; &lt;dependency&gt; &lt;dependentAssembly&gt; &lt;assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*" /&gt; &lt;/dependentAssembly&gt; &lt;/dependency&gt; &lt;trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"&gt; &lt;security&gt; &lt;requestedPrivileges&gt; &lt;requestedExecutionLevel level="requireAdministrator" uiAccess="false"/&gt; &lt;/requestedPrivileges&gt; &lt;/security&gt; &lt;/trustInfo&gt; &lt;/assembly&gt; </code></pre> <p>2) You can launch a secondary process elevated that would do the task or create a COM object that runs elevated, you can find more info in these MSDN entries </p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/bb756922.aspx" rel="noreferrer"><code>Redesign for UAC Compatibility</code></a></li> <li><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms679687%28v=vs.85%29.aspx" rel="noreferrer">The COM Elevation Moniker</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload