Live Binding with Automatic updates in XE3 (no need to call Notify() as in XE2)

LiveBindings happen by binding any object with another object of interest based on some events. This happens by an observer pattern, when there is event trigger, the object inspector will be notified and the inspector will notify the already registered components to display the changes. Hope this helps. There is lot of documentation for this … Read more

How Do I Choose Between the Various Ways to do Threading in Delphi?

If you are not experienced with multi-threading you should probably not start with TThread, as it is but a thin layer over native threading. I consider it also to be a little rough around the edges; it has not evolved a lot since the introduction with Delphi 2, mostly changes to allow for Linux compatibility … Read more

Delphi XE6 link C code in iOS

The code looks proper and your calling convention handling is, to my eyes, perfectly correct. I think you may have ran into a possible/rumoured bug in Apple’s ARM clang where calling a static function (which may happen behind the scenes e.g. for type conversion) from a static function may cause stack corruption. You’re not doing … Read more

Webview not displaying in MacOS using Delphi XE2

Getting the NSWindow of a FMX form convert a TForm reference to a NSWindow set Host Window. MyWebView.setHostWindow(MyNSWindow) procedure TForm2.Button1Click(Sender: TObject); var […] ObjTOC: TOCLocal; MyNSWindow : NSWindow; […] ObjTOC := (FmxHandleToObjC(Form2.Handle) as TOCLocal); MyNSWindow := NSWindow(TOCLocalAccess(ObjTOC).Super); PWebView := TWebView.Alloc.initWithFrame(MakeNSRect(10, 10, 300, 300), nil, nil); MyWebView := TWebView.Wrap(PWebView); MyWebView.setHostWindow(MyNSWindow); […] MyWebView.mainFrame.loadRequest(urlreq); end;

Why is it bad practice to call an eventhandler from code?

It’s a question of how your program is organized. In the scenario you’ve described, the menu item’s behavior will be defined in terms of the button’s: procedure TJbForm.MenuItem1Click(Sender: TObject); begin // Three different ways to write this, with subtly different // ways to interpret it: Button1Click(Sender); // 1. “Call some other function. The name suggests … Read more

Is the compiler treatment of implicit interface variables documented?

If there is any documentation of this behavior, it will probably be in the area of compiler production of temporary variables to hold intermediate results when passing function results as parameters. Consider this code: procedure UseInterface(foo: IInterface); begin end; procedure Test() begin UseInterface(Create()); end; The compiler has to create an implicit temp variable to hold … Read more

Split a string into an array of strings based on a delimiter

you can use the TStrings.DelimitedText property for split an string check this sample program Project28; {$APPTYPE CONSOLE} uses Classes, SysUtils; procedure Split(Delimiter: Char; Str: string; ListOfStrings: TStrings) ; begin ListOfStrings.Clear; ListOfStrings.Delimiter := Delimiter; ListOfStrings.StrictDelimiter := True; // Requires D2006 or newer. ListOfStrings.DelimitedText := Str; end; var OutPutList: TStringList; begin OutPutList := TStringList.Create; try Split(‘:’, ‘word:doc,txt,docx’, … Read more

Required tags not present when using Delphi XML Data Binding Wizard

Not sure to understand but maybe what you are looking for is : use=”optional” <xs:element name=”MyReport” type=”MyReportType” /> <xs:complexType name=”MyReportType”> <xs:all> <xs:element name=”Header” type=”HeaderType” use=”optional” /> <xs:element name=”Values” type=”ValuesType” use=”optional” /> <xs:element name=”Events” type=”EventsType” use=”optional” /> </xs:all> </xs:complexType> Tell me if it’s okay.

Is there a way to programmatically tell if particular block of memory was not freed by FastMM?

Even if such handler exist, it would be nearly useless, as everything, including DB would be shut down at the time when FastMM reports leaks. So, I suggest you to turn on LogErrorsToFile along with FullDebugMode conditionals in FastMM4Options.inc. This will give you a text file with leaks, which later you can parse and put … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)