Delphi: Prompt for UAC elevation when needed

i would relaunch yourself as elevated, passing command line parameters indicating what elevated thing you want to do. You can then jump right to the appropriate form, or just save your HKLM stuff. function RunAsAdmin(hWnd: HWND; filename: string; Parameters: string): Boolean; { See Step 3: Redesign for UAC Compatibility (UAC) http://msdn.microsoft.com/en-us/library/bb756922.aspx This code is released … Read more

Why cannot take address to a nested local function in 64 bit Delphi?

This trick was never officially supported by the language and you have been getting away with it to date due to the implementation specifics of the 32 bit compiler. The documentation is clear: Nested procedures and functions (routines declared within other routines) cannot be used as procedural values. If I recall correctly, an extra, hidden, … Read more

How can I search for Delphi documentation? [closed]

You can navigate to the front page of the Embarcadero documentation and search from there. The link is: http://docwiki.embarcadero.com/RADStudio/en/Main_Page Note that no version is included in the link. If you navigate to that link then the site will re-direct you to a version specific URL for the latest release. In this case, as I write … Read more

Why can a WideString not be used as a function return value for interop?

In regular Delphi functions, the function return is actually a parameter passed by reference, even though syntactically it looks and feels like an ‘out’ parameter. You can test this out like so (this may be version dependent): function DoNothing: IInterface; begin if Assigned(Result) then ShowMessage(‘result assigned before invocation’) else ShowMessage(‘result NOT assigned before invocation’); end; … Read more