Jump to content

ChrisChuah

Members
  • Content Count

    121
  • Joined

  • Last visited

Everything posted by ChrisChuah

  1. ChrisChuah

    Indy 9.0.18 on Delphi 6. Where can i get 9.0.50?

    Hi Remy attached is the Computil which i compiled under Delphi 6 in win XP. regards chris Computil_compiledD6XP.zip
  2. ChrisChuah

    Indy 9.0.18 on Delphi 6. Where can i get 9.0.50?

    Finally managed to install Indy 10 on Delphi 6. I need to remove the indy60.bpl files from c:\windows\system32 as well as c:\program files\borland\delphi6\projects\bpl also remove all the indy*.bpl from those 2 directories and install the delphi 10 dpk file seems like need to install packages from different directories as compared to Indy9 Install the design package from Core then Protocol directory. Is this correct? regards chris
  3. ChrisChuah

    Indy 9.0.18 on Delphi 6. Where can i get 9.0.50?

    Hi I tried to install Indy 10.6.2 into Delphi 6. First I would need to recompile the CompUtils.dpr under delphi 6 running in Windows XP as i think the CompUtils.exe is not meant for Win XP. After compiling that into CompUtils.exe, i run the fulld_6.bat in terminal mode Once that has been done, Open the Delphi 6 and compile the package IndyCore60.dpk. When i tried to install it, it prompted me "Cannot load package IndySystem60. It contains unit IdWinSock2 which is also contained in Package Indy60." Then i recompile and install dclIndyCore60.dpk and it came out the same message. "Cannot load package IndySystem60. It contains unit IdWinSock2 which is also contained in package Indy60 Then i recompile and install IndySystem60.dpk and another message "Cannot load IndySystem60. It contains unit IdGlobal which is also contained in package Indy60. Where is Indy60 package? I tried to look for it but cant find it. please advise regards chris
  4. Hi I am having a problem with this function. When issued a ClientDataset.open, the Before Open event is triggered but before the After event is triggered, it returned an Access violation ==== Access Violation Log ===== 22-12-7 14:46:48-10.100.252.26> LoadTableData2 SQL: SELECT ROW_ID,CREATED_AT,CREATED_BY,FIDSID,AODBID,EVENT,FLIGHT,DOMINT,SDT,TABLENAME,TABLENUMBER,XMLFILE FROM DYNAFLTS WHERE (CREATED_AT>=1670342400 and CREATED_AT<1670428800) <22-12-7 14:46:48-10.100.252.26> cdsDYNAFLTS Before Open <22-12-7 14:46:48-10.100.252.26> Error in LoadFilterTable: Access violation at address 00F5CC2B in module 'FidsEventViewer.exe'. Read of address 00000000 <22-12-7 14:46:48-10.100.252.26> App Exception: cdsDYNAFLTS: Cannot perform this operation on a closed dataset === ========= ==== Normal log on other machine ==== <7/12/2022 2:53:56 pm-192.168.0.124> LoadTableData2 SQL: SELECT ROW_ID,CREATED_AT,CREATED_BY,FIDSID,AODBID,SDT,FLIGHT,DOMINT,TABLENAME,EVENT,XMLFILE FROM DYNAFLTS WHERE (CREATED_AT>=1670342400 and CREATED_AT<1670428800) <7/12/2022 2:53:56 pm-192.168.0.124> cdsDYNAFLTS Before Open <7/12/2022 2:53:56 pm-192.168.0.124> cdsDYNAFLTS Start AfterOpen <7/12/2022 2:53:56 pm-192.168.0.124> cdsDYNAFLTS Start read INI <7/12/2022 2:53:56 pm-192.168.0.124> cdsDYNAFLTS End read INI <7/12/2022 2:53:56 pm-192.168.0.124> cdsDYNAFLTS Assign Field to process <7/12/2022 2:53:56 pm-192.168.0.124> cdsDYNAFLTS End AfterOpen ============= In my code, the SQL is added to TQuery The Client dataset is link to the Provider. The provider is linked to TQuery. This application is run on another machine without this error but always gives an access violation on this machine. Is there a "cache" file that ClientDataset would read after the BeforeOpen event? Please advise regards chris
  5. ChrisChuah

    TClientDataset gives access violation when open

    hi attached is the code whereby it generated the error. The funny thing is that this app can run on other machines without error but only that particular machine. procedure TDataModule1.loadFilterTable; var l_str : string; l_ini : TIniFileEx; l_fieldList : string; begin if (trim(FFilterDay) = '') and (Trim(FFilterOthers) = '') then l_str := '' else if (Trim(FFilterDay) = '') and (Trim(FFilterOthers) <> '') then l_str := Trim(FFilterOthers) else if (Trim(FFilterDay) <> '') and (Trim(FFilterOthers) = '') then l_str := Trim(FFilterDay) else l_str := Trim(FFilterDay) + ' and ' + Trim(FFilterOthers); cdsDYNAFLTS.Close; qyDYNAFLTS.Close; if DataModule1.getLoginSuccess then begin try cdsDYNAFLTS.IndexName := ''; cdsDYNAFLTS.Filter := ''; cdsDYNAFLTS.Filtered := false; qyDYNAFLTS.SQL.Clear; l_Ini := TIniFileEx.create(ChangeFileExt(Application.ExeName, '.ini')); l_fieldList := l_ini.ReadString(DYNAFLTS_TABLE, INI_SECT_FIELDS, ''); // cc : if the field list is still empty, then make it a * if Trim(l_fieldList) = '' then l_fieldList := '*'; l_ini.Free; qyDYNAFLTS.SQL.Add('SELECT ' + l_fieldList + ' FROM ' + DYNAFLTS_TABLE ); if l_str <> '' then qyDYNAFLTS.SQL.Add(' WHERE ' + l_str); DoLog('LoadTableData2 SQL: ' + qyDYNAFLTS.SQL.Text); cdsDYNAFLTS.ProviderName := ''; cdsDYNAFLTS.ProviderName := 'dspDYNAFLTS'; cdsDYNAFLTS.Active := true; <== when open is called, the BeforeOpen will be logged. However the afterOpen is not called except on e:Exception do begin if not CheckDBConnectionError(e.message) then DoLog('Error in LoadFilterTable: ' + e.message); <== this will log down the access violation as shown int he log end; end; end; end;
  6. ChrisChuah

    Is there FMX System Reboot component

    Hi In Windows, there is a TWinExit component to allow us to reboot the OS from our software. Is there one that can reboot the Linux OS? Or is there a script component whereby the software can call it to reboot? please advise regards chris
  7. ChrisChuah

    Audio Over IP (AES 67)

    Hi Is there any component for delphi that can convert wave files to be streamed over internet using AES 67? please advise regards chris
  8. ChrisChuah

    Audio Over IP (AES 67)

    Or is there any components that can implement dante audio to transfer audio over ethernet to Bosch Praesideo ?
  9. ChrisChuah

    Wiegand component

    Hi Is there any component that can interface directly to wiegand interface that is usually used for smart card / security? Or need a hardware to convert it to a Serial 232 ? any advice? regards chris
  10. ChrisChuah

    XML viewer component

    Hi Is there a XML Viewer component rather than using the TWebBrowser component? Although i can use the TMemo component to load the xml but the output is not that pretty. Please advise regards chris
  11. ChrisChuah

    XML viewer component

    hi here is the getItInstall.log. From GitHub, it states that SynEdit supports up to Delphi 10.4 Could this error due to not able to support 11.1? regards chris ====== Start ====== [2022-08-29 09:28:55] [DEBUG] GetIt: Loading EULAS... [2022-08-29 09:29:02] [DEBUG] GetIt: Installing Library "SynEdit for VCL"... [2022-08-29 09:29:03] [DEBUG] GetIt: Downloading Library "SynEdit for VCL"... [2022-08-29 09:29:07] [DEBUG] GetIt: Extracting Library "SynEdit for VCL" to "C:\Users\chuahyen\Documents\Embarcadero\Studio\22.0\CatalogRepository\SynEdit-2022.03-11\". This could take a while... [2022-08-29 09:29:08] [DEBUG] GetIt: Compiling project "SynEditDR.dproj"... [2022-08-29 09:29:13] [DEBUG] GetIt: Problem occurred when compiling for "Win64" platform with "Release" configuration. [2022-08-29 09:29:15] [DEBUG] GetIt: Problem occurred when compiling for "Win64" platform with "Debug" configuration. [2022-08-29 09:29:17] [DEBUG] GetIt: Problem occurred when compiling for "Win32" platform with "Release" configuration. [2022-08-29 09:29:18] [DEBUG] GetIt: Problem occurred when compiling for "Win32" platform with "Debug" configuration. [2022-08-29 09:29:19] [DEBUG] GetIt: Error when executing an action of "SynEdit for VCL" catalog. The action is "CompileProject" (ID 6). [2022-08-29 09:29:19] [DEBUG] GetIt: A problem occurred during the process. [2022-08-29 09:29:26] [DEBUG] GetIt: Cancelling process... [2022-08-29 09:29:39] [DEBUG] GetIt: Loading EULAS... [2022-08-29 09:29:41] [DEBUG] GetIt: Installing Library "SynEdit for VCL"... [2022-08-29 09:29:41] [DEBUG] GetIt: Downloading Library "SynEdit for VCL"... [2022-08-29 09:29:42] [DEBUG] GetIt: Extracting Library "SynEdit for VCL" to "C:\Users\chuahyen\Documents\Embarcadero\Studio\22.0\CatalogRepository\SynEdit-2022.03-11\". This could take a while... [2022-08-29 09:29:42] [DEBUG] GetIt: Compiling project "SynEditDR.dproj"... [2022-08-29 09:29:45] [DEBUG] GetIt: Problem occurred when compiling for "Win64" platform with "Release" configuration. [2022-08-29 09:29:47] [DEBUG] GetIt: Problem occurred when compiling for "Win64" platform with "Debug" configuration. [2022-08-29 09:29:48] [DEBUG] GetIt: Problem occurred when compiling for "Win32" platform with "Release" configuration. [2022-08-29 09:29:50] [DEBUG] GetIt: Problem occurred when compiling for "Win32" platform with "Debug" configuration. [2022-08-29 09:29:50] [DEBUG] GetIt: Error when executing an action of "SynEdit for VCL" catalog. The action is "CompileProject" (ID 6). [2022-08-29 09:29:50] [DEBUG] GetIt: A problem occurred during the process. [2022-08-29 09:32:26] [DEBUG] GetIt: Cancelling process... ===== End =======
  12. ChrisChuah

    XML viewer component

    tried to install the SynEdit via PackageManager and it could not be installed on Delphi 11.1 Anyone encountered this problem? regards chris
  13. HI I am having this funny problem in Delphi 11.1 using VCL. ==== FDetailForm := TfrmAircraftTypesNew.Create(self); try (FDetailForm as TfrmAircraftTypesNew).setData(UpdateRow, l_rec); FDetailForm.Visible := false; FDetailForm.ShowModal; finally l_rec.Free; end; FDetailForm := nil; ======= When i open and close the FDetailForm a few times, the detail form would not show and the main window will hang. See this video to see what i mean. In the Form Close of the TfrmAircraftTypesNew, i will have Action := caFree; Screen Recording 2022-08-22 at 20.55.21.mp4 Can help why the form is not able to show on top. I have already tried to put the PopupMode to Explicit. Another Finding: when i remove or commented the style from the startup, i did not have this problem of not able to showModal Application.Initialize; // TStyleManager.TrySetStyle('Iceberg Classico'); <== Remove/commented this line Application.CreateForm(TDataModule1, DataModule1); Application.CreateForm(TfrmMain, frmMain); Application.Run; Not sure why this style is giving problem.... Please advise regards chris
  14. Ok. I will try to write a small part of the code to see if i can reproduce the same error or not thanks chris
  15. We are just learning. I am still learning too I tried not to create the form but to call showmodal each time user click on the update button But i will get a problem is that cannot Showmodal when the form is visible. In the FormClose of aircrafttype form, i set it to caHide instead of caFree and i have that error. I feel that even though i have use delphi since Delphi 1, i am still learning how to use this language. Delphi 6 was the most stable version that i used and I am still using that now to do minor changes to those application written in 2007.
  16. The DetailForm close event will have Action := caFree I tried this way ===== Ghosting Windows procedure DisableProcessWindowsGhosting; var DisableProcessWindowsGhostingProc: procedure; begin DisableProcessWindowsGhostingProc := GetProcAddress( GetModuleHandle('user32.dll'), 'DisableProcessWindowsGhosting'); if Assigned(DisableProcessWindowsGhostingProc) then DisableProcessWindowsGhostingProc; end; begin Application.Initialize; DisableProcessWindowsGhosting; TStyleManager.TrySetStyle('Iceberg Classico'); Application.CreateForm(TDataModule1, DataModule1); Application.CreateForm(TfrmMain, frmMain); Application.Run; end. ======================= But will also have the same effect that open and close the form too many times will result in hanging of the application or the form will not show. Only when i removed the Style Manager, then i will not have this problem. The Grid is also having its own DrawColumnCell Event ===================== procedure TfrmMain.dbgACTDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var l_bitmap : TBitmap; l_rect : TRect; l_bmpWidth, l_width : integer; l_str : string; begin with dbgACT do begin if (gdSelected in State) then begin Canvas.Font.Color := clBlack; Canvas.Brush.Color := clLime; end else begin if ( (DataSource.Dataset).RecNo mod 2 = 0) then begin if Canvas.Brush.Color = Color then begin Canvas.Brush.Color := clSkyBlue; end; end; end; end; l_rect := Rect; l_str := Column.Field.DisplayText; l_width := dbgACT.Canvas.TextExtent(l_str).cx + 5; if Column.FieldName = 'ROW_ID' then begin l_bitmap := TBitmap.create; try ImageList2.GetBitmap(tsACT.ImageIndex, l_bitmap); l_bmpWidth := (Rect.bottom - Rect.Top); l_rect.Right := Rect.Left + l_bmpWidth; dbgACT.Canvas.StretchDraw(l_rect, l_bitmap); finally l_bitmap.Free; end; // cc : reset the output rectangle l_rect := Rect; l_rect.Left := l_rect.Left + l_bmpWidth; l_width := 5 + dbgACT.Canvas.TextExtent(l_str).cx; end; if (l_width > Column.Width) then Column.Width := l_width; dbgACT.DefaultDrawColumnCell(l_rect, DataCol, (Column as TColumn), State); end; ==================== But not sure if this affected the style manager or not regards chris
  17. Hi When the database table is updated and i use dbgrid.datasource.dataset.refresh, the dbgrid is refreshed back to the first row. Is it possible to refresh the grid without going back to the first row? This is because if there is frequent update to the database and this Refresh notification is sent to my app each time another app updates the table, the dbgrid will always move back to the first row when it is refreshed. Any advise regards chris
  18. ChrisChuah

    DBGrid repaint or refresh when dataset is refreshed

    Thanks. need to use locate with disable/enable controls so that the table will not have moving effect. However, for my dataset, it has 50 columns but the dbgrid can only show first 10 columns on the screen. If need to show next 10 columns, i will need to scroll to the next 10 columns. So, when i am looking at the next 10 columns and the table refreshed, can the refresh go to the next 10 columns rather than always go back to the 1st 10 columns? regards cris
  19. ChrisChuah

    DBGrid repaint or refresh when dataset is refreshed

    hi i have tried using gotobookmark on TQuery with TClientDataset and it could not work. Will try to use the locate function. thanks
  20. ChrisChuah

    DBGrid repaint or refresh when dataset is refreshed

    hi ok i will try it with the locate function for the disablecontrols and enablecontrols thanks chris
  21. ChrisChuah

    DBGrid repaint or refresh when dataset is refreshed

    If there is frequent update to the table, then the user will see the table moving up and down (always locating the record) isnt it? will this (record pointer moving up and down on the grid) happen?
  22. Hi Is there a way to auto detect when there is no mouse activity and the VCL application will log out for users? thanks chris
  23. ChrisChuah

    auto close or logout when no mouse activity

    Hi I managed to implement it in windows using this event TfrmMain : TForm Gauge1 : TGauge; tmrInactivity: TTimer; procedure FormCreate(Sender: TObject); procedure tmrInactivityTimer(Sender: TObject); private FInactivityTimeout : cardinal; FInactivityCounter : cardinal; // cc : application event to handle key down and left mouse click // cc : for activity timeout procedure ApplicationEventMsg(var Msg: tagMSG; var Handled: Boolean); public end; procedure TfrmMain.FormCreate(Sender: TObject); var l_ini : TIniFile; begin // this event msg is to capture keyboard and mouse event Application.OnMessage := ApplicationEventMsg; // cc : get the amount of seconds allowed before timeout l_ini := TIniFile.create(ChangeFileExt(Application.ExeName, '.ini')); FInactivityTimeout := l_ini.ReadInteger('Main', 'Inactivity Timeout', 60); Gauge1.MaxValue := FInactivityTimeout; Gauge1.MinValue := 0; FInactivityCounter := 0; l_ini.Free; end; procedure TfrmMain.tmrInactivityTimer(Sender: TObject); begin // Inactivity timeout will disconnect every connection tmrInactivity.Enabled := false; if (not DataModule1.getLoginSuccess) then begin FInactivityCounter := 0; Gauge1.Progress := 0; tmrInactivity.Enabled := true; exit; end; if (FInactivityCounter > FInactivityTimeout) then begin DataModule1.closeAll; end; FInactivityCounter := 0; Gauge1.Progress := 0; end else begin FInactivityCounter := FInActivityCounter +1; Gauge1.Progress := FInactivityCounter; end; tmrInactivity.Enabled := true; end;
  24. Hi I am using TSQLQuery, TClientDataSet and TDataSetProvider with DBGrid If i want to sort the DBGrid based on title column click, i can use the event OnTitleClick on DBGrid ClientDataSet.IndexFieldsName := Column.FieldName However, this will sort the Field in ascending order. How can i sort it in descending order? please advise regards chris
  25. ChrisChuah

    DBGrid sort descending on Column Title Click

    Hi I have another question. After i use the AddIndex and set the IndexName to the index field created, how can i get back the information of what index field is used and what is the sorting order (asc or desc) e.g. l_indexName := 'ABN_REM' + '_INDEX'; l_indexes := TStringList.create; (TntDBGrid1.DataSource.DataSet as TClientDataSet).GetIndexNames(l_indexes); if l_indexes.IndexOf(l_indexName) > -1 then (TntDBGrid1.DataSource.DataSet as TClientDataset).DeleteIndex(l_indexName); l_indexes.Free; (TntDBGrid1.DataSource.DataSet as TClientDataset).AddIndex(l_indexName, 'FREE_REM', [ixDescending],'','',0 ); (TntDBGrid1.DataSource.DataSet as TClientDataset).IndexName := l_indexName; In the above code, i have set the IndexName to 'ABN_REM_INDEX' with field 'FREE_REM' used and sort in descending order. So, how can i get back this information that the field name 'FREE_REM' is used and the sorting is in descending order? regards chris
×