JackT
Members-
Content Count
19 -
Joined
-
Last visited
Community Reputation
0 NeutralTechnical Information
-
Delphi-Version
Delphi 11 Alexandria
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
I am creating a string list on a thread inside a function like this class AQNI : public TThread { //Some definitions } AQNI * mythread; bool AQNI::ReadXMLData { TStringList * ATB = new TStringList(); //Access violation occurs here the 2nd time the thread is created { //DO SOME STUFF } __finally { delete ATB; } return true; } The first time the thread is created everything runs fine. After I have finished with threaded object I destroy the thread and wait for a command and to start a data collection loop at which point I Free and delete mythread. However when I recreate my thread and call the ReadXMLData function when I try to create a fresh string list the whole thing falls over with an access violation. I am surprised the code is broken because it was previously working. The exception is ocuring in BorlndMM ( Borland Memory Manager ) :69d29df9 BORLNDMM.@Borlndmm@SysGetMem$qqri + 0x3d
-
Update I have managed to make my own TMaterial(s) and TMaterialSource(s) for direct X11 and write my own rudimentary shaders in hlsl. The only problem I have found is with the example code is where TCustomDX9Context / TCustomDx11Context etc is defined so I have had to comment some checks out in order to get the materials to work. I don't know where these classes have been moved to in Rad Studio 12. I am working purely on the windows platform so this isn't a big issue. Thanks for your help Best Regards Jack T
-
I have a grid of 64 sensors that are measuring magnetic fields in the range 0 to 150 Hz. The grid is non rectelinear. The idea was to build a mesh in the shape of the grid and then use a shader to set positive values red and negative values blue in real time. So all I really need to do is to pass a float in along with each vertex. I have started learning high level shader language to try to accomplish this. Best Regards, Jack T
-
Thanks for the reply. That code looks like the kind of think I need to do. So as you said there don't seem to be any built in materials or shaders in firemonkey that are set up to do this. I found an article that goes through the steps you need to create custom TMaterial and shaders so you are right it looks like I can have a go at coding it myself. https://blog.grijjy.com/2021/01/14/shader-programming/ I will give it a go and report back.
-
I wish to use some thing like a TMesh component and be able to assign a color value dynamically to each vertex for the purpose of producing a color map for data cluster visualisation. Is there an easy way to do this in firemonkey ? Thanks for any help in advance. Jack T
-
Hi I found a solution on stack overflow. https://stackoverflow.com/questions/3671042/mask-password-input-in-a-console-app I improved the function so it deletes it's input if you back space function GetPassword(const InputMask: Char = '*'): string; var OldMode: Cardinal; c: char; I,L:Integer; begin GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), OldMode); SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), OldMode and not (ENABLE_LINE_INPUT or ENABLE_ECHO_INPUT)); I:=0; try while not Eof do begin Read(c); if c = #8 then begin L:=Length(Result); if L>0 then begin Write(#8' '#8); Result := LeftStr(Result,L-1); continue; end; end else if C=#13 then begin break; end else begin Result := Result + C; Write(InputMask); end; end; finally SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), OldMode); end; end;
- 1 reply
-
- win32
- command prompt
-
(and 2 more)
Tagged with:
-
I am trying to hide console input when a user has to enter a password in a command prompt window. I had the bright idea of redirecting the output of the command prompt to the NUL file but this code does not work even though you can execute the function without error. I am sure there used to be an easy way to do this! Do forget to include windows in the uses clause. Thanks for any help in advance Jack T function GetPassWordInput:String; var C:Char; S:String; H,HNULL:Cardinal; B:BOOL; begin HNULL := CreateFile('NUL',GENERIC_WRITE,FILE_SHARE_WRITE,nil, OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM,0); Assert(HNULL <> 0,'CREATING NUL FILE FAILED'); H:= GetStdHandle(STD_OUTPUT_HANDLE); B:=SetStdHandle(STD_OUTPUT_HANDLE,HNULL); Assert(B,'Set standhard handle failed to assign HNULL'); try begin repeat Read(C); if C=#8 then begin if Length(S)>1 then begin S:=LeftStr(S,Length(S)-1); end; end else if C<>#13 then begin S:=S+C; end; until C=#13; end finally begin SetStdHandle(STD_OUTPUT_HANDLE,H); CloseHandle(HNULL); end; end; Result := S; end;
- 1 reply
-
- win32
- command prompt
-
(and 2 more)
Tagged with:
-
I have been looking for a list of existing property editor classes supported in FireMonkey. I am specifically looking for the property editor that generates the combobox of styles using the StyleLook up property in the ObjectInspector. I don't know where the property editor for StylelLook up is registered ? I wish to use the property editor with my own components with one or more style settings. Thanks for any help in advance.
-
I solved the problem by writing my own implementation of IFMXDialogServiceAsync and IFMXDialogService for windows.
-
function FMXMessageDialog(const AMessage: string; const ADialogType: TMsgDlgType; const AButtons: TMsgDlgButtons; const ADefaultButton: TMsgDlgBtn): Integer; var mr: TModalResult; begin mr:=mrNone; // standart call with callback anonimous method TDialogService.MessageDialog(AMessage, ADialogType, AButtons, ADefaultButton, 0, procedure (const AResult: TModalResult) begin mr:=AResult end); while mr = mrNone do // wait for modal result Application.ProcessMessages; Result:=mr; end; The code works fine. However depending on which monitor the dialog spawns on, on my system the text is clipped. Dragging the dialog back to monitor 1 from monitor 2 makes the dialog draw correctly. Delphi Alex 11.3. The scale on monitor 1 is 150% and and on monitor 2 it's 100%.
-
Thanks for the reply. Unfortunately I forgot to mention I am developing a Firemonkey application so TNumberBox has a different implementation to the VCL component with the same name, although I did post the question in the FMX group.
-
Is there an easy way to change the formatting of the text in a TSpinBox ? I would like my TSpinBox to display a number with a leading 0 for a 24 hour clock format So instead of showing 9 it would show 09 as in "zero nine hundred hours". I am aware there is a TTimeEdit, but it puts it's spinner in an up down configuration not it in a side to side configuration like the TSpinBox. I am using TSpinBox to set YEAR - MONTH - DAY so I would like everything to look the same,
-
Look for a digital signal processing library which utilizes GPU
JackT posted a topic in General Help
I am writing a program that process data from 196+ channels in real time. I will have to employ digital filter(s) of one sort or another on all 196+ channels simultaneously. It occurred to me that a digital signal processing pipeline on a GPU would be an ideal solution. The data is sampled at 1200 Hz. My question is - Is there a parallel digital signal processing pipeline library for Delphi or C++ builder out there that takes advantage of GPU architecture ? If there is no such library should I code one using NVIDA's CUDA or AMD ROCm ? -
I'm trying to call Application->Messagebox in a C++ Builder BPL
JackT replied to JackT's topic in General Help
Thanks for the advice - much appreciated. I think I just assumed that the pointer for interfaces were going to be the same sorts in Delphi.- 8 replies
-
- c++ builder bpl vcl
- delphi
-
(and 1 more)
Tagged with: