Delphi

How to send email with attachment using default Android email app - Delphi XE7

帅比萌擦擦* 提交于 2020-01-02 18:07:10
问题 Using code below which I found on another post, the email appears ready to send with the attachment, but when email is received, there is no attachment. Also, the email address has to be manually entered, it is not populated by the CreateEmail statement. I am sending from a gmail account. Anyone help please? procedure TForm1.CreateEmail(const Recipient, Subject, Content, Attachment: string); var Intent: JIntent; Uri: Jnet_Uri; AttachmentFile: JFile; begin Intent := TJIntent.Create; Intent

How can I detect if a Delphi class has a virtual constructor?

亡梦爱人 提交于 2020-01-02 18:06:28
问题 For example, is there a way to find out that this class has a virtual constructor (at runtime)? TMyClass = class(TObject) MyStrings: TStrings; constructor Create; virtual; end; For example, in this code I would like to test if the class referenced by Clazz has a virtual constructor: procedure Test; var Clazz: TClass; Instance: TObject; begin Clazz := TMyClass; Instance := Clazz.Create; end; Is there a simple solution, for example using RTTI, which works in Delphi 6 to 2009? 回答1: Looking

How can I detect if a Delphi class has a virtual constructor?

淺唱寂寞╮ 提交于 2020-01-02 18:05:39
问题 For example, is there a way to find out that this class has a virtual constructor (at runtime)? TMyClass = class(TObject) MyStrings: TStrings; constructor Create; virtual; end; For example, in this code I would like to test if the class referenced by Clazz has a virtual constructor: procedure Test; var Clazz: TClass; Instance: TObject; begin Clazz := TMyClass; Instance := Clazz.Create; end; Is there a simple solution, for example using RTTI, which works in Delphi 6 to 2009? 回答1: Looking

How to detect the input device if mouse and touchpad are both enabled

别来无恙 提交于 2020-01-02 18:04:11
问题 I already have a WH_MOUSE_LL hook in my application, but need a different behavior for Mouse and Touchpad. I know about Raw Input API, but have no idea how to use it with hooks :( Any suggestions? 回答1: It should be the same as distinguishing between multiple keyboard devices. 回答2: Disassemble some Touchpad driver and see how it works. This is the only way to go, cause drivers might use different methods of mouse emulation. And don't forget to vote for my answer ;). 回答3: I was tried

How can I add a library path to a delphi project?

陌路散爱 提交于 2020-01-02 16:18:25
问题 I have a couple precompiled (3rd party) libraries that I need to use in my project. I can get it to build if I put foo.a in the root of my project folder, however, I have a 32 bit version and a 64 bit version of the library and I don't want to have to swap out foo.a with foo.32.a and foo.64.a every time I build each version of the application. In this particular case I've put them in: [myroot]\iOSDevice32\Debug\foo.a [myroot]\iOSDevice32\Release\foo.a and [myroot]\iOSDevice64\Debug\foo.a

Post JSON data to RESTful datasnap server from delphi client

北城余情 提交于 2020-01-02 16:18:06
问题 I need to send a simple JSON object to a Restful datasnap server (Delphi) from a Delphi client. I am using Delphi XE. Can anybody help me out with the code? I am trying for hours but not getting it.. Please ask if details are not sufficient Edit: Here is server side method declaration: procedure updatemethodnme(str:string):string; and here is client side code: function PostData(request: string): boolean; var param: TStringList; url, Text,str: string; code: Integer; http: TIDHttp; begin Result

Java JNA Mapping in Delphi Dll function

。_饼干妹妹 提交于 2020-01-02 15:26:07
问题 How do i map this function with JNA: Delphi Dll Function Code: function send_command (const command : byte; var size : byte; var data : pbyte) : integer; stdcall external 'comunication.dll'; Use example in Delphi Example Program: send_command (cmdCLOCK_ADJUST, tam, pb); Where: const cmdCLOCK_ADJUST = $18; var tam : byte; pb, p : pbyte; begin ... tam = 7; p:= pb; for i:= 1 to tam do begin p^:= Dados [i]; inc (p) end; send_command (cmdCLOCK_ADJUST, tam, pb); freemem (pb); ... end The int value

Create a form within a new Desktop using CreateDesktop/SwitchDesktop

*爱你&永不变心* 提交于 2020-01-02 15:04:40
问题 I need to create a system modal form for an utility that should block the entire windows until certain values are entered. So I'm experimenting with creating desktops and switching. So far, creating a desktop switching to it, and going back works fine for me. But, when I try to create a form, from within a new thread, the form does not show up but the application keeps in the newly created blank desktop, therefore blocking the screen forever until I logoff. I made it based in the code found

Create a form within a new Desktop using CreateDesktop/SwitchDesktop

眉间皱痕 提交于 2020-01-02 15:02:34
问题 I need to create a system modal form for an utility that should block the entire windows until certain values are entered. So I'm experimenting with creating desktops and switching. So far, creating a desktop switching to it, and going back works fine for me. But, when I try to create a form, from within a new thread, the form does not show up but the application keeps in the newly created blank desktop, therefore blocking the screen forever until I logoff. I made it based in the code found

ComboBox Simple with Bitmap

懵懂的女人 提交于 2020-01-02 14:32:19
问题 How do I put a bitmap in a combobox with style set to simple? For example, Google Chrome has the star on the right, Firefox has the arrow on the right. I tried this code: procedure TForm2.ComboBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); var ComboBox: TComboBox; bitmap: TBitmap; begin ComboBox := (Control as TComboBox); Bitmap := TBitmap.Create; try ImageList1.GetBitmap(0, Bitmap); with ComboBox.Canvas do begin FillRect(Rect); if Bitmap.Handle <> 0