Delphi

Read .wav file using delphi

梦想的初衷 提交于 2020-01-01 07:12:31
问题 I now currently try to read .wav file using delphi here is my code : type TWaveHeader = packed record Marker_RIFF: array [0..3] of char; ChunkSize: cardinal; Marker_WAVE: array [0..3] of char; Marker_fmt: array [0..3] of char; SubChunkSize: cardinal; FormatTag: word; NumChannels: word; SampleRate: longint; BytesPerSecond: longint; BytesPerSample: word; BitsPerSample: word; Marker_data: array [0..3] of char; DataBytes: longint; end; TChannel = record Data : array of double; end; some private

How to Append rows to an Excel Sheet?

左心房为你撑大大i 提交于 2020-01-01 07:08:26
问题 I am developing an application that need to generate excel sheets. How do we append rows to an existing excel sheet? I am using Delphi 2007.(and I am using SM Software TXLS... components...but I am ok with answers in native delphi excel components). Thanking you all, Pradeep 回答1: Over the years, I've found Deborah Pate's site has helped me by providing useful code samples: http://www.djpate.freeserve.co.uk/AutoExcl.htm. We use the CreateOleObject approach. 回答2: Normally you won't need to

How to monitor the keyboard above all other applications and then send other keys to them instead

自闭症网瘾萝莉.ら 提交于 2020-01-01 07:08:00
问题 I am building an multimedia console based on an old computer running Win7. I want to control the players with a numeric keyboard. I can't use the common media control devices because they respond only to windows media player. I will use the KVM Player, Winamp and others. So each one has it's own set of keyboard shortcuts for play, pause, foward, volume etc. For that I am thinking of building a Delphi application that detects the foreground application and gets from a database the shortcuts

Parsing xml file Delphi

我的梦境 提交于 2020-01-01 07:03:19
问题 Firstly, I'm new to coding and Delphi, been on and off with it for a few months. Below is a sample xml file. What I'm trying to achieve is to Parse all data in each 'Name' section of the .xml file. I have never done this before. Some guidance would be appreciated. I have looked at other questions on here similar to this but I cant quite get to grips with it. I have no code example to provide....this is how stuck I am, I do not know where to begin. <ds> <Customers> <Name> <address_name>test 1<

Let stay thread running on form close

孤者浪人 提交于 2020-01-01 07:02:52
问题 I made a syncing thread on my application and I want to know is there a way to let the thread stay open until it finishes it's syncing process, if i close the application form? 回答1: In the commentary to Rob's excellent answer, the question of showing UI whilst waiting was raised. If you need to show UI whilst waiting, then you will need a more advanced wait that TThread.WaitFor . This is what I use in its place, relying on MsgWaitForMultipleObjects. procedure WaitUntilSignaled(Handle: THandle

Delphi - Application independent of Regional Settings

一世执手 提交于 2020-01-01 07:01:41
问题 I need to make an application(D2006) independent of Regional Settings, most important all the dateformats must be the same. For the begging I want to replace all the FormatDateTime('adateformate') with FormatDateTime('aConstantDefined'). Also Application.UpdateFormatSettings and Application.UpdateMetricSettings should be set to False. Is there anything else I should make/take care? LE: problem is that I have users with 2 different Regional Settings, and they don't want to uniform their

Sending email in Delphi without smtp and using php function at server

最后都变了- 提交于 2020-01-01 07:00:54
问题 Using Delphi, i want to send a text message to my web server using winsock, and then use an email php function on the server to post the message. First i have done the sending procedure (Procedure SendEmail): it reads a text file (log) and POST it to my server. On the server, the message is received by aa email php function named email.php (see content of that function below): Procedure SendEmail; var WSADat:WSAData; // winsock.pas Texto:TextFile; Client:TSocket; Info,Posting,Linha,Content

Delphi XE – Datasnap Filter problems

為{幸葍}努か 提交于 2020-01-01 07:00:27
问题 I have a tcp/ip Datasnap -XE Server that uses a PC1 and Zlib filter On the Client both of these filters are defined in DataSnap TSqlConnection When the client connects to the server I get a "Connection Closed Gracefully” error message If I only use the PC1 filter on its own - there is no problem If I only use the Zlib filter on its own - there is no problem Any Ideas on how I can get both filters working at the same time? 回答1: You need to deploy the libeay32.dll and ssleay32.dll with your

Quickest way to find the oldest file in a directory using Delphi

我与影子孤独终老i 提交于 2020-01-01 07:00:08
问题 HI We have a large number of remote computers that capture video onto disk drives. Each camera has it's own unique directory and there can be up to 16 directories on any one disk. I'm trying to locate the oldest video file on the disk but using FindFirst/FindNext to compare the File Creation DateTime takes forever. Does anybody know of a more efficient way of finding the oldest file in a directory? We remotely connect to the pc's from a central HO location. Regards, Pieter -- Update Thank you

How to create graphs in Delphi application

徘徊边缘 提交于 2020-01-01 06:46:26
问题 I need to create graphs on the fly about specific process, with some informative texts and colors. In the Unix world there's Graphviz including 'dot' for layout generation, is there something similar which could be used with Delphi? I'm using Delphi 2007. Also Python alternative could be considered, but I'd prefer pure Delphi in this case. 回答1: @Harriv, You can try WinGraphviz wich is a COM Wrapper for Graphviz. check this link for more info. 回答2: You can use SimpleGraph from DelphiArea. A