Delphi

Delphi Timer Issue

大城市里の小女人 提交于 2020-01-06 19:30:44
问题 procedure TForm1.Timer2Timer(Sender: TObject); var ff : integer; begin for ff := 0 to 32 do If CardArray[NewValue] + CardArray[NewValue3] = PlayArray[ff] then begin sndPlaySound('cashregister.wav', snd_Async or snd_NoDefault); end else begin SendClick(451,541); end; end; Can anyone spot a reason to why this would be working incorrectly? Its triggering SendClick() when it shouldn't be... is there a reason why the if and else is not working ? for i := 0 to 32 do If CardArray[NewValue] +

Concatenate TStringStream

空扰寡人 提交于 2020-01-06 19:26:11
问题 I would like to concatenate some TStringStreams into one Stream. I have some blob (varbinary(max)) fields in SQL Server and and I want to create a stream from all the rows then save it to a file. var // MSWord: Variant; i: Int32; sA: TStringStream; sP: TStringStream; s: TStringStream; // fString: TStrings; begin sA := TStringStream.Create; s := TStringStream.Create; sP := TStringStream.Create; try with DateED do begin BlobField.SaveToStream(sA); sA.SaveToStream(s); // s.CopyFrom(sA, sA.Size);

Indy 10 Multipart upload to OneDrive Error

假装没事ソ 提交于 2020-01-06 18:10:32
问题 I am trying to do Multipart upload to OneDrive using POST and get 'HTTP/1.1 400 Bad Request'. IdLogFile: Stat Connected. Sent 10.02.2017 12:50:08: POST /v1.0/drive/root::/children HTTP/1.0`<EOL>`Content-Type: multipart/related; boundary="Boundary"`<EOL>`Content-Length: 254`<EOL>`Authorization: Bearer EwA...%3d`<EOL>`Host: api.onedrive.com`<EOL>`Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`<EOL>`Accept-Encoding: identity`<EOL>`User-Agent: Mozilla/3.0 (compatible;

Indy 10 Multipart upload to OneDrive Error

泄露秘密 提交于 2020-01-06 18:10:24
问题 I am trying to do Multipart upload to OneDrive using POST and get 'HTTP/1.1 400 Bad Request'. IdLogFile: Stat Connected. Sent 10.02.2017 12:50:08: POST /v1.0/drive/root::/children HTTP/1.0`<EOL>`Content-Type: multipart/related; boundary="Boundary"`<EOL>`Content-Length: 254`<EOL>`Authorization: Bearer EwA...%3d`<EOL>`Host: api.onedrive.com`<EOL>`Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`<EOL>`Accept-Encoding: identity`<EOL>`User-Agent: Mozilla/3.0 (compatible;

Get HID Device data only from my delphi application

六眼飞鱼酱① 提交于 2020-01-06 16:52:30
问题 I have 2 keyboards attached via usb. I want that my application to receive input only from one of them. I tried to use the TJvHidDeviceController i sucesefully get a handle to the device but i can't get any data. Is it possible to prevent other applications to receive input from the second keyboard ? 回答1: Is it possible for your set-up to not load a device driver for the keyboard you want to listen to? If it is, you could try this method: Use QueryDosDevice to list all devices on your

How to dynamically create customized TabSheet runtime

女生的网名这么多〃 提交于 2020-01-06 16:33:02
问题 I would like to create a TTabsheet which has to be create during run time. The TTabSheet has several components, but all of these components will be identical on every tab. Is it possible to create a "type" variable which will create these tabs every time? Thanks 回答1: Yes. You could create inherited class from TTabSheet TCustomTabSheet = class(TTabSheet) public constructor Create(AOwner : TComponent); override; public FTestButton : TButton; end; constructor TCustomTabSheet.Create(AOwner :

How to dynamically create customized TabSheet runtime

…衆ロ難τιáo~ 提交于 2020-01-06 16:31:21
问题 I would like to create a TTabsheet which has to be create during run time. The TTabSheet has several components, but all of these components will be identical on every tab. Is it possible to create a "type" variable which will create these tabs every time? Thanks 回答1: Yes. You could create inherited class from TTabSheet TCustomTabSheet = class(TTabSheet) public constructor Create(AOwner : TComponent); override; public FTestButton : TButton; end; constructor TCustomTabSheet.Create(AOwner :

How can I calculate sql tables in delphi ?

老子叫甜甜 提交于 2020-01-06 16:26:44
问题 Hi I have sql table I want to calculate all the fields to total sum field. 回答1: You can do this in the SELECT statement you use to get the data, something like SELECT *, big1 + small1 as "TotalSum" from adlar Obviously, you can add more numeric fields to the fields to sum. 回答2: procedure TForm1.Button1Click(Sender: TObject); begin ADOQuery1.Close; ADOQuery1.SQL.Text:='select boyuk1 + kicik1 + qara1 + boyuk2 + kicik2 + boyuk3 * 0,35 as totalsum from adlar2v'; //(table name:adlar2v) ADOQuery1

Managed Debugging Assistant 'PInvokeStackImbalance' has detected a… on trivial method

走远了吗. 提交于 2020-01-06 15:54:08
问题 I am calling a Delphi function from C# and get the error: Managed Debugging Assistant 'PInvokeStackImbalance' has detected a problem in ... I've exhausted attempts changing the .Net code to fit the Delphi signatures, why it doesn't work with basic Integers has me stumped, does anyone know where I am going wrong? Even the simplest function using 2 integers produces the error. I'm targeting x86 and have put in a couple of hours research but the following solutions haven't helped here, here and

TChromium mouse click

拜拜、爱过 提交于 2020-01-06 14:34:45
问题 I would like to simulate the mouse click on a page. I'm using TChromium in Delphi. I've tried the following code, but it did not work. code := 'document.getElementById(_2lkdt).click();'; Chromium1.Browser.MainFrame.ExecuteJavaScript(Code, 'about:blank', 0); The page button is this: <button class="_2lkdt"> <span data-icon="send" class=""> <svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"> <path fill="#263238" fill-opacity=".45" d="M1.101 21.757L23