Jump to content


Popular Content

Showing content with the highest reputation on 02/28/21 in all areas

  1. David Heffernan

    Can Delphi randomize string 'Delphi'?

    @Mike Torrettinni now that we all know your password I suggest you change it!
  2. Attila Kovacs

    Delphi 10.4.2 first impressions

    This is called the generic navigation. 😛
  3. stijnsanders

    Can Delphi randomize string 'Delphi'?

    Aah, that makes me think of the infinite monkeys theorem (and also)
  4. Attila Kovacs

    Can Delphi randomize string 'Delphi'?

    But they don't use random in bruteforcing as it has no benefits.
  5. Doesn't seem like nitpicking here. It seems like it actually matters whether the issue is that the compiler has generated the code, or that the debugger won't break on it. Both seem to have been called in to question. As somebody who tries to solve problems, I know that clear terminology makes it possible to clearly specify and describe the problem.
  6. David Heffernan

    exit terminates delphi app

    I called it like this: procedure TPythonEngine.Execute(const Code: PAnsiChar; const globals, locals: IPyDictionary); var retval: PPyObjectRef; begin retval := PyRun_StringFlags(Code, Py_file_input, globals.Ref, locals.Ref, nil); CheckError(Assigned(retval)); DecRef(retval); end; I passed exit() in via the Code argument, and empty dicts in globals and locals. retval comes back nil and CheckError is my function to extract tracebacks. I know we looked at way back when we first embedded Python. I honestly don't recall the details. I think some part of the decision will be my own fastidiousness to have total control over everything, and as you know P4D has a huge range of functionality. We only scratch at the surface of what P4D can do. Our usage is a finite element structural engineering code which allows users to customise some parts of the calculation and post-processing by calling Python code that they provide. So we just need to create instances, populate attributes, and call the user function passing in those instances. Then we need to read out the attributes from those instances after the user script has run. It's such a tiny part of what P4D offers, that we just did it ourself. The way our wrapper exposes Python is much closer to the metal than P4D I believe. We use interfaces to wrap Python objects, and because they are also reference counter, that fits really nicely with the Python ref count. When our implementing wrapper objects are destroyed (because the Delphi ref count goes to zero), we just call Py_DecRef on the underlying Python object. I seem to recall that in P4D client code you sometimes have to deal with the Python ref code, but we've been able to hide that from our client code. Anyway, embedded Python is a truly remarkable achievement, and P4D is clearly a fantastic library. Our software would be far poorer without embedded Python.
  7. balabuev

    Delphi 10.4.2 first impressions

    type TFoo = TObject; TBar = TDictionary<Byte, Byte>; var a: TFoo; // Ctrl+Click here navigates to TFoo, despite it's an alias. b: TBar; // Ctrl+Click here navigates to TDictionary<> in Generics.Collections unit.
  8. balabuev

    Delphi 10.4.2 first impressions

    Confirmed. I can reproduce it. However in my case no stack overflow occured. IDE simply hang out (forewer) with this small popup window:
  9. Lajos Juhász

    Delphi 10.4.2 first impressions

    For me also the IDE asked for international characters (looks like the forum likes to insert those ones). Congratulation you managed to make Delphi unresponsive without debugging. With debug I also get: Project bds.exe raised exception class $C00000FD with message 'stack overflow at 0x51ef04f2. :51ef04f2 ; C:\Windows\SysWOW64\msxml6.dll :51f16f2d ; C:\Windows\SysWOW64\msxml6.dll :51f56860 ; C:\Windows\SysWOW64\msxml6.dll :51f296da ; C:\Windows\SysWOW64\msxml6.dll :51f566ea ; C:\Windows\SysWOW64\msxml6.dll :51f18b90 ; C:\Windows\SysWOW64\msxml6.dll :51f18163 ; C:\Windows\SysWOW64\msxml6.dll xmlrtl.Xml.Win.msxmldom.TMSDOMNodeList.get_length xmlrtl.Xml.XMLDoc.TXMLNode.GetIsTextElement :0c1b42ec ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl :0c1b4390 ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl :0c1b4390 ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl :0c1b4390 ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl :0c1b4390 ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl .....cut, here the IDELSP270.bpl repeats 9992 times..... :0c1b4390 ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl :0c1b4390 ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl fmx.FMX.Platform.Win.TPlatformWin.ThreadSync(???) rtl.System.Classes.StdWndProc(1705986,0,0,0) vcl.Vcl.Forms.TApplication.ProcessMessage(???)
  10. KodeZwerg

    Totally new to this area

    Wikipedia look under 'Computing' to getting started.
  11. Remy Lebeau

    Is this C++ builders new FORUM ???

    I miss the old newsgroups 😢 None of the newer web-based forums have really matched up to them, in terms of usability, monitoring, organization. It is just not the same.
  12. balabuev

    TTreeNode leak when VCL styles are active

    Hmm, now I cannot believe also. Will try to debug. Edit: These four controls - are styled scrollbars (TScrollingStyleHook.TScrollWindow). Edit: Workaround: type TTreeViewFix = class(TComponent) private FView: TTreeView; FOldWnd: TWndMethod; protected procedure Notification(C: TComponent; O: TOperation); override; procedure WndHook(var M: TMessage); public class procedure Apply(AView: TTreeView); end; procedure TTreeViewFix.Notification(C: TComponent; O: TOperation); begin inherited; if (C = FView) and (O = opRemove) then begin FView.WindowProc := FOldWnd; Free; end; end; procedure TTreeViewFix.WndHook(var M: TMessage); begin if (M.Msg = WM_NCDESTROY) and (csDestroying in FView.ComponentState) then FView.Items.Clear; FOldWnd(M); end; class procedure TTreeViewFix.Apply(AView: TTreeView); var fx: TTreeViewFix; begin fx := TTreeViewFix.Create(nil); try fx.FView := AView; fx.FOldWnd := AView.WindowProc; AView.WindowProc := fx.WndHook; AView.FreeNotification(fx); except fx.Free; raise; end; end; procedure TMainForm.FormCreate(Sender: TObject); begin TTreeViewFix.Apply(TreeView); //... end;