Jump to content

Attila Kovacs

Members
  • Content Count

    1977
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by Attila Kovacs

  1. Attila Kovacs

    License key system

    @David Heffernan Actually I do. Actually I was the first who did. No clue why are you chanting the same.
  2. Attila Kovacs

    License key system

    @David Heffernan I'm telling the same. The phrase you quoted was referring to the action "wiping a disk", if a "bug" could cause that, that bug doesn't have to be on purpose.
  3. Attila Kovacs

    License key system

    Well, it's a bit overdramatized, this would also mean that any bug could wipe a disk, or eject the DVD with a speed which cuts off the customers head. Doesn't matter if on purpose or not. But you are right, it's a very bad solution. I would rather afraid that if any result caused by a bug on purpose results in any health/material/monetary loss, one could be held accountable for the damages. Irrespective of the fact if a software was licensed or not.
  4. Attila Kovacs

    Why this code fail?

    @aehimself Ah, I see. You are right, it should be ok. I have also used a helper like this for centuries, it was error prone and annoying initializing the querys to nil. Which is obviously the problem what OP has, unitialized parameter. Then I switched to ORM, since then I can't stand such code anymore 😉
  5. Attila Kovacs

    Why this code fail?

    @aehimself If it's not marked as "var" the parameter is just a preinitialized local var which won't be freed, as this was a factory logic originally. Or am I missing something?
  6. Attila Kovacs

    Why this code fail?

    @aehimself "var" also enforces passing a variable to the method, in this case it would be bad if you could call it with nil. Anyway, this kind of lazy initialization will fail on local variables as they are not automatically set to nil, I would forget it forever.
  7. Attila Kovacs

    Where did I come from

    Same goes for checkbox too... Did you check TDBRadioGroup? Can't you use that instead?
  8. Attila Kovacs

    TEmbeddedWB in a 64 Bit application

    TWebBrowser is in SHDocVw.pas which has FSetExceptMask(femALLEXCEPT); in the initialization section. I don't know ~WB.
  9. Also downloaded successfully with the orange button on the top right without any problem. Version 81.0.4044.113 (Official Build) (64-bit). The app looks interesting, is it like Regiograph?
  10. Attila Kovacs

    Threading question

    That's true. But if he goes: var FSomething: PChar; procedure HandleMessage(var Msg: TMessage); begin FSomething := PChar(Msg.WParam); end; then that was it. And depending on how he is populating the log messages, the memory manager could give him the same address for X times in the client thread. To have even more fun in debugging.
  11. Attila Kovacs

    Threading question

    @Darian Miller I've slightly modified your code, with the sleep you can fine-tune to get it synced 😉 procedure TMyThread.Execute; var Buffer: string; r: integer; begin while (not Terminated) do begin r := random(3242424); Buffer := TEST_STRING + inttostr(r); PostMessage(MainWindowHandle, WM_STATUSOUT, WParam(PChar(Buffer)), r); // Sleep(30); end; end; // Main thread procedure TForm1.WmStatusOut(var Msg: TMessage); begin if PChar(Msg.WParam) <> TEST_STRING + inttostr(Msg.LParam) then begin OutputDebugString(PChar(Msg.WParam)); end; end; or if we want more dramatic results: procedure TMyThread.Execute; var p: pchar; r: integer; begin while (not Terminated) do begin r := random(3242424); p := StrNew(pchar(TEST_STRING + inttostr(r))); try PostMessage(MainWindowHandle, WM_STATUSOUT, WParam(p), r); finally StrDispose(p); end; // Sleep(30); end; end;
  12. Attila Kovacs

    Difference between Pred and -1

    @Mike Torrettinni Nothing special, I thought you like exotic methods 😉
  13. Attila Kovacs

    Difference between Pred and -1

    @Mike Torrettinni Do you know Concat() ?
  14. Attila Kovacs

    Threading question

    Press F7 or F8 to start the debugging session for the application and in CPU View on the code pane press ctrl+g and enter $0040DD41. Which line is it in the code? But It's a low address, so it will be most likely system.pas, so you have to look after the call stack, either on AV or by putting a breakpoint there with a condition. Also, there is an inherited; in the message handler, how do the other handlers look like?
  15. "Debouncing". Slow users are out of luck.
  16. Attila Kovacs

    pipeline and visual feedback

    What is the proper way to display the progress from a pipeline stage when the main thread is blocked by WaitFor()? VCL.
  17. Is it possible to retrieve a notebooks serial number? Is it stored anywhere? Ok, I have found it. Btw. the compiled demos on your homepage are detected by chrome (or windows?) as malicious (virus inside the zip). It would be a good idea to sort it out as a host application could have the same problem if linked with this lib.
  18. Attila Kovacs

    pipeline and visual feedback

    Ooookay, everything is working perfectly, it was a journey, transforming the legacy code to work with OTL, which I really enjoyed. It's frightening how easy and how fast can you write complex and _working_ code with this lib. The online documentation seems to be a bit behind the current release (didn't check the book yet), so I took a copy of the book at leanpub with a custom input in the box as a small donation and a big thank you.
  19. is it ok regarding to multithread design pattern to free an object in a different process thread as it was created in? Seems to work, but are there any caveats? function TfrmSync.NewCookieList: TclCookieList; begin Result := TclCookieList.Create(nil, TclCookieItem); Result.Assign(FCookies); end; mainthread begin ... Fpipeline := Parallel.pipeline.Stage(Retriever, ....)...Run; Fpipeline.input.Add(TRetrieverParam.Create(..., NewCookieList)); <---- New instance ... Fpipeline.input.CompleteAdding; end; procedure TfrmSync.Retriever(const input: TOmniValue; var output: TOmniValue); begin ..... TRetrieverParam(input).CookieList.Free; <---- EOL end;
  20. Attila Kovacs

    freeing an object in different process

    @Fr0sT.Brutal eauhm, yes, thread of course.... thanks!
  21. Attila Kovacs

    pipeline and visual feedback

    Never underestimate this kind of answers, this tells me always that there is a user error. It was. Thx. I have here something what I'm not getting and very hard to debug. (got it, not even multi threading problem, it just revealed it \o/) btw, I still can't figure out what "Parallel.TaskConfig.OnMessage(Self)" does, as 2nd parameter to a stage. thx
  22. Attila Kovacs

    FireDac Query Issue

    It "closes" the dataset, then you can manipulate its properties including sql text etc.. then you set it active again with open() or with sql() in firedac, I'm not familiar with the "sql()" method, but it's for sure a shortcut for setting the Sql text, parameters and opening the query.
  23. Attila Kovacs

    FireDac Query Issue

    anyway, you could consider using temporary queries instead of one (or more) particular queries as a swiss knife on a datamodule: procedure DoSomething; var Q: TFDQuery; begin Q := TFDQuery.Create(nil); try Q.Connection := dm.FDConnection1; Q.Sql('....'); <DoSomething> Q.Close; finally Q.Free; end; end; or similar.. or "Q" as a class Field like "FQxy" if you have to work with db controls...
  24. Attila Kovacs

    FireDac Query Issue

    if this works without a ".close" between the two ".open()" then I'm speechless.
  25. Attila Kovacs

    Random Access Violation?

    AV's are cool, because you have the address. btw, did you look for pervasive/windows logs?
×