Delphi

TAcroPDF loses resolution after form has resized

坚强是说给别人听的谎言 提交于 2020-01-07 03:26:08
问题 Im creating PDF's with Debenu and saving them. Then AcroPDF.LoadFile loads the PDF. If I start my app and load a file, all is well. I can even resize with this PDF after loading. However, if I have resized my app in any way (doesn matter if it is back to the size i started) and then load, the PDF loses resolution. The AcroPDF doesnt align and isnt anchored (doesnt matter if it is). And when I open the generated PDF with Arcobat Reader the resolution is great. This problem only seems to occur

Using Outlook Contacts In Delphi XE7

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-07 03:03:44
问题 I am trying to get a list of all outlook contacts using delphi. I found a couple of examples, all seemed to be outdated or flawed. Currently I have the following code, but when I excecute the command at runtime I get the below error: Code: procedure Tinvite_friends.BitBtn2Click(Sender: TObject); const olFolderContacts = $0000000A; var outlook, NameSpace, Contacts, Contact: OleVariant; i: Integer; begin Try outlook:=GetActiveOleObject('Outlook.Application'); Except outlook:=CreateOleObject(

Delphi: Simulating a drag and drop from the clipboard to EmbeddedWB’s IHTMLElement

人盡茶涼 提交于 2020-01-07 03:00:55
问题 I have a Delphi XE2 application with a TEmbeddedWB that I use to simulate user actions. The application navigates to a URL, populates the relevant form fields with data and submits the data. The problem is that there is an <input type=file /> field which accepts files that are uploaded. Having done a lot of reading on the matter I understand there is a security issue doing this programmatically but also found someone making a suggestion that the files could be ‘dragged’ from the clipboard and

Upgrading Delphi 7 Indy 9 app. to Indy 10

大兔子大兔子 提交于 2020-01-07 02:56:23
问题 I have inherited an extensive (199 commands) Delphi 7 Indy 9 app that I am upgrading to Indy 10 (in D10.1). I have upgraded all the code, and it compiles and runs. The problem I have is that now in Indy 10 all the handlers also return a response code (and text) in addition to the coded response that they did under Indy 9. For example: // server procedure TFormMain.IdCmdTCPServer1loginCommand(ASender: TIdCommand); var Rights: String; begin if BillingUserRegistered(ASender.Params[0], ASender

Code for UPDATE and DELETE in delphi uniquery

烂漫一生 提交于 2020-01-07 02:30:05
问题 I'm trying to update and delete my record. I'm using dbgrid as to show the database and i use uniquery to do the query. I managed to do the insert query but not with the update and delete. Here is my code : unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Grids, Vcl.DBGrids, Data.DB, DBAccess, Uni, UniProvider, MySQLUniProvider, MemDS, Vcl.StdCtrls, DAScript, UniScript; type

delphi D10 TListView使用复选框的BUG修改

点点圈 提交于 2020-01-07 02:17:13
在安卓下使用TListView时,需要使用到复选框,同时系统定义的几种类型如:ListItemShowCheck、ImageListItemShowCheck等都不能满足功能的需要,所以需要使用自定义显示内容,在定义好后,发现复选框不能正确使用,如下图设置:“ClickOnSelect”…(过程与原因不详说了,没时间,今天直接说结果) 结果发现代码(FMX.ListView.Types文件: TListItemGlyphButton类): procedure TListItemGlyphButton.DoClick; begin inherited; if not FClickOnSelect then FCallback(nil, Self, TListItemCallbackOp.Click); end; inherited; 继承交类的过程,而父类中的代码是FCallback(nil, Self, TListItemCallbackOp.Click);,也就是说,当TListItemGlyphButton.DoClick执行时,如果ClickOnSelect设置为False,则ListView1ButtonClick会执行两次。因些将这里代码做了修改,注释inherited; 。再测试,我自己程序运行正常,因未做更深入测试,目前暂不清楚是否会对其他处理过程具有影响。 经查

delphi set the TExpander height

与世无争的帅哥 提交于 2020-01-06 21:11:05
问题 i've a TExpander component and i add some TTexts to it at runtime , the issue i'm facing is : how can this Expander's height be set based on the Number of the TTexts , something like AutoSize ? the code i'm using : procedure TForm1.Button5Click(Sender: TObject); var _DailyEvent:TDailyEvents; Eventstext:TText; _Y:Integer; begin _Y:=10; For _DailyEvent in DailyEventsList do begin Eventstext:=TText.Create(Self); Eventstext.Position.Y := _Y; Eventstext.Align:=TAlignLayout.Top; Eventstext.Height:

Sequential Multi-Threading

好久不见. 提交于 2020-01-06 20:01:39
问题 I wanna build Multi-Threaded procedure for the following code, but not able to correctly build it. I tried using Semaphore to sequentially complete the code but it only executed the myStream2.CopyFrom(myStream1, StrToInt64('$' + SL1[(i - 1)])); part which comes under else part. The problem presents is that if we restore those streams into output filestream (mystream2) haphazardly, the file will corrupt. Can anyone help me please. for i := 1 to SL1.Count do begin if Length(SL1[i - 1]) > 12

What is the correct way to structure this generic object creation

白昼怎懂夜的黑 提交于 2020-01-06 19:45:35
问题 Ignoring the fact that this uses the Aurelius Framework, this question is more about how I need to re-tweak the code to make the generic constructor injection work for both type: < string > and < TCustomConnection > Also ignore the fact that the child objects are in the same unit, I would generally put them in their own, but this just makes it easier to post in a question. I'm trying use the Factory Method pattern to determine what type of connection it should be making at runtime depending

Delphi Timer Issue

徘徊边缘 提交于 2020-01-06 19:30:51
问题 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] +