XPath and TXmlDocument

I can’t find anything in the TXMLDocument documentation about XPath. XML example, from the OmniXML XPath demo: <?xml version=”1.0″ encoding=”UTF-8″?> <bookstore> <book> <title lang=”eng”>Harry Potter</title> </book> <book> <title lang=”eng”>Learning XML</title> </book> <book> <title lang=”slo”>Z OmniXML v lepso prihodnost</title> <year>2006</year> </book> <book> <title>Kwe sona standwa sam</title> </book> </bookstore> Try something like this: uses XMLDoc, XMLDom, XMLIntf; … Read more

Putting classes in a DLL?

It is not possible to get a Class/Instance from a DLL. Instead of the class you can hand over an interface to the class. Below you find a simple example // The Interface-Deklaration for Main and DLL unit StringFunctions_IntfU; interface type IStringFunctions = interface [‘{240B567B-E619-48E4-8CDA-F6A722F44A71}’] function CopyStr( const AStr : WideString; Index, Count : Integer … Read more

How to add manifest info into delphi project

Here are some links Delphi and Windows Vista User Account Control Vista UAC Manifest Here are the steps: Create XML file with following content: <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?> <assembly xmlns=”urn:schemas-microsoft-com:asm.v1″ manifestVersion=”1.0″> <assemblyIdentity version=”1.1.1.1″ processorArchitecture=”X86″ name=”YourApplicationExeName” type=”win32″/> <description>elevate execution level</description> <trustInfo xmlns=”urn:schemas-microsoft-com:asm.v2″> <security> <requestedPrivileges> <requestedExecutionLevel level=”requireAdministrator” uiAccess=”false”/> </requestedPrivileges> </security> </trustInfo> </assembly> Name this XML file as … Read more

How can I allow a form to accept file dropping without handling Windows messages?

You don’t need to handle messages to implement this. You just need to implement IDropTarget and call RegisterDragDrop/RevokeDragDrop. It’s really very very simple. You can actually implement IDropTarget in your form code but I prefer to do it in a helper class that looks like this: uses Winapi.Windows, Winapi.ActiveX, Winapi.ShellAPI, System.StrUtils, Vcl.Forms; type IDragDrop = … Read more

How to change the implementation (detour) of an externally declared function

Yes you can do that, using the ReadProcessMemory and WriteProcessMemory functions to patch the code of the current process. Basically, you get the address of the procedure or function to patch and then insert a Jump instruction to the address of the new procedure. Check this code Uses uThirdParty; //this is the unit where the … Read more

Delphi: why breakpoints from time to time are not usable (green highlighted line on IDE)?

Debug info isn’t present in the file. Make sure that you’re using the Debug configuration. (Project Manager tree, expand Build Configurations, make sure Debug is bold. If it’s not, right click Debug and choose Activate from the context menu.) Make sure you then do a Build of your project, not just a Compile. If that … Read more