Delphi

function mapping delphi/pascal dll in jna handle and string

微笑、不失礼 提交于 2020-01-05 12:07:08
问题 I'm trying to call a function in a delphi dll using JNA. the function definition is: function myFuncGetName (aHandle : THandle; var aBuf : pwideChar ): integer; export; my jna mapping looks like this: int myFuncGetName(PointerByReference aHandle, WString aBuf); the return value should be 0 for success and -1 for fail and I'm always getting -1. I have started up WinDbg and attached to the process and it breaks at myFuncGetName. 057cb384 eb11 jmp myDLL!myFuncGetName+0x87 (057cb397) 057cb386

IDHTTP.Post error

蓝咒 提交于 2020-01-05 10:30:11
问题 procedure Texport_plan.cxB_LoadClick(Sender: TObject); var HTTP: TIdHTTP; Query: String; Buffer: TMemoryStream; loadData: Sting; responseData: String; begin try HTTP := TIdHTTP.Create(nil); HTTP.Request.ContentEncoding := 'utf-8'; HTTP.Request.ContentType := 'text/xml'; Application.ProcessMessages; Query := 'http://priem.edu.ru:8000/import/ImportService.svc/import'; loadData := '<Root></Root>' Buffer := TMemoryStream.Create; loadData.SaveToStream(Buffer); responseData := HTTP.Post(Query,

初学 Delphi 嵌入汇编[30] - 寄存器表

旧街凉风 提交于 2020-01-05 09:55:56
类型 名称 二进制码 寄存器说明 多功能寄存器 AL 0 累加寄存器低八位 AH 100 累加寄存器低八位 AX 0 16 位累加寄存器 EAX 0 32 位累加寄存器 BL 11 基址寄存器低八位 BH 111 基址寄存器低八位 BX 11 16 位基址寄存器 EBX 11 32 位基址寄存器 CL 1 计数寄存器低八位 CH 101 计数寄存器低八位 CX 1 16 位计数寄存器 ECX 1 32 位计数寄存器 DL 10 数据寄存器低八位 DH 110 数据寄存器低八位 DX 10 16 位数据寄存器 EDX 10 32 位数据寄存器 指针寄存器 SP 100 16 位堆栈指针寄存器 ESP 100 32 位堆栈指针寄存器 BP 101 16位基址指针寄存器 EBP 101 32 位基址指针寄存器 变址寄存器 DI 111 16 位目标变址寄存器 EDI 111 32位目标变址寄存器 SI 110 16 位源变址寄存器 ESI 110 32位源变址寄存器 专用寄存器 IP * 16 位指令指针寄存器 EIP * 32 位指令指针寄存器 FLAGS * 16 位标志寄存器 EFLAGS * 32位标志寄存器 段寄存器 CS 1 代码段寄存器 DS 11 数据段寄存器 ES 0 附加段寄存器 SS 10 堆栈段寄存器 FS 100 标志段寄存器 GS 101 全局段寄存器

Only One CheckBox Checked at a time

最后都变了- 提交于 2020-01-05 09:23:41
问题 [Compiler: Delphi XE2] I have spent all day yesterday trying all sorts of ways to accomplish this specific task but they have all ended in the same result. Using TRZCheckGroup and this example to see what has been checked ect.. procedure TFrmMain.cbOptionsChange(Sender: TObject; Index: Integer; NewState: TCheckBoxState); var ItmIndex0, ItmIndex1: Integer; begin { Initialize ItemIndex's } ItmIndex0 := -1; ItmIndex1 := -1; { Return the position Index of the string's(0 and 1) } ItmIndex0 :=

Only One CheckBox Checked at a time

廉价感情. 提交于 2020-01-05 09:22:43
问题 [Compiler: Delphi XE2] I have spent all day yesterday trying all sorts of ways to accomplish this specific task but they have all ended in the same result. Using TRZCheckGroup and this example to see what has been checked ect.. procedure TFrmMain.cbOptionsChange(Sender: TObject; Index: Integer; NewState: TCheckBoxState); var ItmIndex0, ItmIndex1: Integer; begin { Initialize ItemIndex's } ItmIndex0 := -1; ItmIndex1 := -1; { Return the position Index of the string's(0 and 1) } ItmIndex0 :=

Delphi Saving open office document as PDF

放肆的年华 提交于 2020-01-05 08:59:28
问题 I am using the following code to export an Open Office document as a pdf file using Delphi: procedure TOOoWriter.SaveToPDF(FileName: string); var wProperties: variant; begin if not (fConnected and fDocumentOpened) then abort; wProperties := VarArrayCreate([0, 3], varVariant); if fHTMLSrc then wProperties[0] := MakePropertyValue('FilterName', 'writer_web_pdf_Export') else wProperties[0] := MakePropertyValue('FilterName', 'writer_pdf_Export'); wProperties[1] := MakePropertyValue(

How i can use different text of item text in ComboBox in Delphi

烂漫一生 提交于 2020-01-05 08:54:40
问题 I'm having a TComboBox component(comboxCountry) on my form. And here's the items inside the TComboBox. Item 1 : 'Singapore SG' Item 2 : 'India IND' Item 3 : 'Australia AUS' and etc etc etc .. When the combobox value is changed, i want the combboxCounty.Text to only display the country code instead of the whole String in the items list. For example, i want to only display 'SG' instead of 'Singapore SG' .. Here's how i do for cboxBankCategory OnChange function: if comboxCountry.ItemIndex = 0

How i can use different text of item text in ComboBox in Delphi

谁都会走 提交于 2020-01-05 08:52:12
问题 I'm having a TComboBox component(comboxCountry) on my form. And here's the items inside the TComboBox. Item 1 : 'Singapore SG' Item 2 : 'India IND' Item 3 : 'Australia AUS' and etc etc etc .. When the combobox value is changed, i want the combboxCounty.Text to only display the country code instead of the whole String in the items list. For example, i want to only display 'SG' instead of 'Singapore SG' .. Here's how i do for cboxBankCategory OnChange function: if comboxCountry.ItemIndex = 0

How to populate memtables from enumarations?

大憨熊 提交于 2020-01-05 08:50:14
问题 I use memtables to wire enumerated type with comboboxes using LiveBinding. However I have a lot of them and they way I am doing is way too bad (copy/paste) For example, I have the following enumeration: TEnumResourceType = (trtApp, trtTab, trtSection, trtField, trtCommand, trtOther); and for that I created a function to give the string equivalent: function EnumResourceTypeToStr(AEnum: TNaharEnumResourceType): string; begin case AEnum of trtApp : result := 'Aplicação'; trtTab : result :=

Delphi - Change taskbar icon

妖精的绣舞 提交于 2020-01-05 08:48:55
问题 I have main .exe app and .dll with form. From .exe I can create and show form from the .dll, but it has no taskbar icon (and the small one at the top left). I want to load this icon from another DLL. How can I do it please? 回答1: Here are the things that you need to do. I've not included much detail because your question has little detail and there's no way for me to know exactly how you would fit all this into your program. The point is to make it clear at a high level what you need to do.