TObject(Sender) is unsafe since:
TButton(Edit1).Caption := 'junk code';
will not raise an exception, while:
(Edit1 as TButton).Caption := 'junk code';
will raise an exception. Taken from here.
If you are receiving a message like this, and you know that path exist, also, you added in the system path, then check in Delphi Tools->Options->Environment Variables, if you have path defined there too, then Delphi will override existing...
If you receive that exception, and you are using something like: ... var  Buffer: array [0..MAX_SIZE] of Char;  Than MAX_SIZE is too big, because Char can take small mount of data. Use better something like this: procedure...
Here is an example of function for geting logs from command line. This mean, if you call, for example, chkdsk, you will get what would be writen on a console output. Also, if command failed, you will get that information :) Â function...
If you are using ClientDataSet, with flat file database (SaveToFile, LoadToFile), then also use: procedure TDataModule1.ClientDataSet1AfterOpen(DataSet: TDataSet); begin  ClientDataSet1.LogChanges:=False; end; Because otherwise ClientDataSet...
To save XML in human readable format, using OmniXML you will need these lines of code: Â xml := CreateXMLDoc; xml.PreserveWhiteSpace := False; ... xml.Save('c:file.xml',ofIndent); Â
Thursday, 18 December 2008 | 211 hits | Print | PDF | Report
You need to access computer which is not in a domain? No problem Here is the code: var token: Cardinal; dwResult: DWORD; nr: TNETRESOURCE; sl: TStringList; begin nr.dwType := RESOURCETYPE_DISK; nr.lpProvider := nil; ...
Yesterday, while I was reinstalling a components, my Delphi 2007 suddennly looked like Delphi 7, with undocked IDE, I don't know what happened, but I was able to change like it is described here, I just clicked Embedded designer check box, restarted...