limelect
Members-
Content Count
835 -
Joined
-
Last visited
-
Days Won
1
Everything posted by limelect
-
new version /python-2-execute/
-
Use RxStrUtils.pas large amount of functions that do exactly that Why invent the weel?
-
I downloaded the community edition for evaluation 11.3 On my D10.2.3 I have Avd Manger and SDK manager No such programs on the 11.3 Any advice? Can I compile it for Android? Ndk and SDK exist. Can I copy the above programs to (user) 22 folder?
-
I found this project https://github.com/jpalbert/webcam-settings-dialog-windows I changed the bat to chcp 65001 > nul ffmpeg -f dshow -show_video_device_dialog true -i video="Integrated Camera" and it works however, doing the same with Delphi does not work as I have GetDosOutput that does not do the job Any idea how to do this with Delphi? GetDosOutput works when I read info from a program I tried to delete the repeat section Any other Dos reading? procedure TForm1.GetDosOutput(CommandLine: string); const ReadBuffer = 32768; // 32kb buffer var SA: TSecurityAttributes; SI: TStartupInfo; PI: TProcessInformation; StdOutPipeRead, StdOutPipeWrite: THandle; WasOK: Boolean; Buffer: array[0..ReadBuffer] of AnsiChar; BytesRead: Cardinal; Handle: Boolean; Apprunning: DWord; // T: Ttime; TotalBytesRead, ExitCode: DWORD; BytesLeftThisMessage, TotalBytesAvail: integer; par_s: string; begin // Result := ''; Application.ProcessMessages; with SA do begin nLength := SizeOf(SA); bInheritHandle := True; lpSecurityDescriptor := nil; end; CreatePipe(StdOutPipeRead, StdOutPipeWrite, @SA, 0); try with SI do begin FillChar(SI, SizeOf(SI), 0); cb := SizeOf(SI); dwFlags := STARTF_USESHOWWINDOW or STARTF_USESTDHANDLES; wShowWindow := SW_HIDE; hStdInput := GetStdHandle(STD_INPUT_HANDLE); // StdOutPipeRead; don't redirect stdin hStdOutput := StdOutPipeWrite; hStdError := StdOutPipeWrite; end; try UniqueString(CommandLine); Handle := CreateProcess(nil, PChar(CommandLine), @SA, @SA, true, (CREATE_NEW_CONSOLE) or (REALTIME_PRIORITY_CLASS), // NORMAL_PRIORITY_CLASS, nil, // PChar(WorkDir), nil, sI, PI); except end; CloseHandle(StdOutPipeWrite); begin repeat Apprunning := WaitForSingleObject(PI.hProcess, 100); Application.ProcessMessages; until (Apprunning <> WAIT_TIMEOUT) { or (stop2)}; repeat if PeekNamedPipe(StdOutPipeRead, @Buffer[0], ReadBuffer, @BytesRead, @TotalBytesAvail, @BytesLeftThisMessage) then if BytesRead > 0 then begin // ReadFile(ReadPipe,Buffer[0], ReadBuffer,BytesRead,nil) ; WasOK := ReadFile(StdOutPipeRead, Buffer[0], BytesRead, BytesRead, nil); if BytesRead > 0 then begin Buffer[BytesRead] := #0; OemToAnsi(Buffer, Buffer); par_s := StrPas(Buffer); if par_s <> '' then Memo1.Lines.Add(par_s); end; end; until (BytesRead > 0) {or (stop2)}; // < ReadBuffer) ; end; finally // stop2 := false; CloseHandle(PI.hThread); CloseHandle(PI.hProcess); CloseHandle(StdOutPipeRead); // GoToFirstLine; end; end;
-
communicate between 2 progs with sendmessage.
limelect replied to JeanCremers's topic in Windows API
use https://torry.net/quicksearchd.php?String=WinPopup&page=1 mdMailSlot it did for me the job -
Prevent Multiple Instance from running at the same time
limelect replied to new_x's topic in Windows API
Use OgFirst from https://github.com/TurboPack/OnGuard-VCL in dpr if TogFirst.IsFirstInstance then begin -------------- end else TogFirst.ActivateFirstInstance; -
First, change the comma to point then use the cell function
-
I hope this will bring you closer to your need https://www.swissdelphicenter.ch/en/showcode.php?id=1302
-
D10.2.3 It Is Ok thanks
-
Thanks, I will wait for the final fix Thanks for the source
-
@FreeDelphiPascal I know the component very well and use it can you put here the fixed source?
-
Although it is not Delphi it is mad with Delphi. In one of my Delphi projects, I used Python and it did not have an execution so I made this application for me BUT it might help OTHERS Python 2 execute https://limelect.com/downloads/python-2-execute/ Good day
-
The program does not matter but basically, it shows database data by using FDConnection1.GetTableNames('', '', '', str, [osMy, osOther], [tkTable], False); and FDConnection1.GetFieldNames('', '', str, '', Str2); Now to the story I got back to this program (that worked) compiled and it stopped working.. I did nothing just compiled. worked on it nothing. went to my backup and copied the main.pas and main.dfm (those are the only files) did not work. . The execution on the backup workers as expected. Mad a new project by copping from backup the dpr pas dfm and compile it does not work. Now to the NOBEL prize. Copy the project from the backup to a directory and compile and it works Check by comparing pas and dfm. same. Check as much as possible DCU with hex program same. size wise both exe are the same. The point is that it is so crazy that I had to share it with you guys.
-
I am baffled. Now the bad is good. The original directory works.!!!!! If there is GOD he fixes things. And suddenly things work. what a field I chose. Thanks, everybody.
-
It seems that a window directory is the problem and Delphi does not help since this instruction FDConnection1.GetTableNames('', '', '', str, [osMy, osOther], [tkTable], false); return 0; The "bad" directory used to be the original directory
-
OK, guys good news and bad news. It is a window problem and Delphi Taking the bad program to a good location it works.
-
yes. It is a portable computer that goes with me everywhere. So it restarts for almost every few days. it is a Lenovo server very powerful. I started this program out of a need for a project. So it worked in this directory.
-
Guys all I say same source different directory One directory gives a bad exe that's it. I do not understand what is not so clear
-
Thanks throw std::exception(“PE Tools source code is not available”); maybe there is No files No source Too simple what I did is much better
-
Everybody says that Delphi IDE is almost foolproof and the source is the problem. I say no. Since it never happened to me I say the compiler is the problem. Why? I do not know.
-
How ? in the IDE? the whole thing started by compiling the same source Into 2 different directories. P.S. very important. The problematic directory originally worked without any problems I came back to it after a few weeks then it happened. Furthermore, the program was on the backup so I could check.
-
No. the project has basically the 2 lines shown in the beginning Nothing special. Guys be aware that the source is the SAME. Nothing else procedure TForm1.fillLists; var i, k: Integer; str, str2: TStringList; begin ListBox1.Clear; ListBox2.Clear; str := TStringList.Create; str2 := TStringList.Create; FDConnection1.GetTableNames('', '', '', str, [osMy, osOther], [tkTable], False); for I := 0 to str.Count - 1 do begin ListBox1.Items.Add(str); ListBox2.Items.Add('Fields of Table ' + str); ListBox2.Items.Add('---------------'); FDConnection1.GetFieldNames('', '', str, '', Str2); for k := 0 to str2.Count - 1 do ListBox2.Items.Add(Str2[k]); ListBox2.Items.Add(''); end; str.Free; str2.Free; end; So simple it baffled me.
-
The time stamp is reasonable. Both projects are debug
-
Okay guys I am still very curious so I made this program information here https://www.swissdelphicenter.ch/en/showcode.php?id=1302 Same source different PE data I do not really know why the compiler makes 2 different execute on the same source but definitely, there is a difference As you can see..