delphi-7

VirtualTreeView add roots with Threads

点点圈 提交于 2019-12-07 20:33:50
问题 I would like to add roots to a VirtualTreeView http://www.delphi-gems.com/index.php/controls/virtual-treeview with a thread like this: function AddRoot ( p : TForm1 ) : Integer; stdcall; begin p.VirtualStringTree1.AddChild(NIL); end; var Dummy : DWORD; i : Integer; begin for i := 0 to 2000 do begin CloseHandle(CreateThread(NIL,0, @ADDROOT, Self,0, Dummy)); end; end; The reason for this is that I want to add all connections from my INDY Server to the TreeView. Indy's onexecute/onconnect get's

How to change color of tcxgrid row

梦想的初衷 提交于 2019-12-07 19:44:13
问题 I want to show some rows from tcxgrid in different color (Depend upon column value ). I did changes for it but its not getting reflected on grid after running my project. procedure TfrmMessaging.cxGrid1DBTableView1CustomDrawCell(..); Var i : Integer; begin For i := 0 To cxGrid1DBTableView1.ViewData.RowCount - 1 Do Begin If cxGrid1DBTableView1.ViewData.Rows[i].Values[4] = '1' Then Begin cxGrid1.Canvas.Brush.Color := clRed; End; End; end; In above code I have used

Converting Delphi 7 property editor to Delphi XE2

拥有回忆 提交于 2019-12-07 19:10:27
问题 First of all, I have never written a property editor from scratch, but had some help with one in another question. Refer to the accepted answer there. This was in Delphi 7, and now I have started using XE2 and I have to make sure my property editor is compatible with both 7 and XE2. It's essentially a collection editor, with the difference that each collection item has its own named component in the parent form. Is there anything new about the property editors in XE2 since 7, since it is a

How to use the CPU window for debugging in D7

荒凉一梦 提交于 2019-12-07 18:26:14
问题 I have an unknown issue that causes the CPU window to appear. I have traced in the source to localize the problem to a call to MMSYSTEM: FError := midioutClose(FMidiHandle); function midiOutClose; external mmsyst name 'midiOutClose'; I have never become proficient with the CPU debugger. There are no symbols, and I have no way of knowing what it is telling me. Can anybody point me to a tutorial on how to use the CPU window of the debugger to find this sort of problem? 来源: https://stackoverflow

Optimal Buffer Stream write process

三世轮回 提交于 2019-12-07 18:06:51
问题 We have our own data streaming algorithm that include some metadata+records+fields values. Currently we use a TStream and write to add values to the stream. Now I'm wondering if this time cosuming operation could be made faster by using some technic. Edit: We are only appending data to the end, not moving or seeking. Some things I was thinking of are: Not use Streams buf some large memory allocated buffer to copy data to, the problem is if we go beyond the buffer size, then we have to

JclMapi mapi general failure

ⅰ亾dé卋堺 提交于 2019-12-07 13:21:58
问题 I have the code: procedure TfrmMain.btnSendClick(Sender: TObject); var aMail: TJclEMail; begin aMail := TJclEMail.Create; Screen.Cursor := crHourGlass; try aMail.Recipients.Add('service@blabla.com'); aMail.Subject := '[IMPORTANT] blablba'; aMail.Body := 'text text text text'; aMail.Send(True); finally Screen.Cursor := crDefault; aMail.Free; end; end; This throws: MAPI Error: (2) "General MAPI failure" Any idea? ps: OS Windows 7 Outlook 2010 Delphi 2007 回答1: I have the same as you, just

how to step into RTL/VCL using Delphi 7

末鹿安然 提交于 2019-12-07 12:08:16
问题 When debugging using the Delphi 7 IDE how can I step into code in the program files/borland/delphi7/source folder? Sounds like a dumb question, but inquiring minds want to debug. (not that I think anything is wrong with the source, I just want to know why for the 9000th time I can't assign a TJpegImage to a TjpegImage). 回答1: Make sure you have the "Use debug dcus" option enabled in the Project Options, and the VCL source folder is in the Debugger's Source path. As for why you cannot assign a

Delphi 7, load PNG to TImage

三世轮回 提交于 2019-12-07 10:02:40
问题 Just want to load a .PNG, tried with my LoadPic() using OleGraphic that works with other formats, but it failed on PNG. The goal is to copy the image to a hidden bitmap whence it is then masked and copied to a visible working image canvas. Feel free to suggest something else if CopyRect doesn't do this. But the main question: Load PNG. How? I've found a lot of pages (f.ex. TPNGImage), but all the resources and links on the web are dead, gone or not downloadable. 回答1: Delphi 7 doesn't support

How to use Interface with VCL Classes - Part 2 [closed]

对着背影说爱祢 提交于 2019-12-07 08:19:07
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . continue with my previous investigation regarding the use of Interface with VCL. How to implement identical methods with 2 and more Classes? How to use Interface with VCL Classes? I would like to have a code

How to remove duplicate resources (RES, DFM) while using Delphi with non specific Library paths?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 07:40:20
问题 I followed the advice received in a previous discussion ( Should "Library path" point to the source files of packages? ) and now my Library Path points to folders containing the compiled code (DCU) and NOT to the source code of my controls. The problem is that I have to duplicate the RES and DFM files and copy them from the 'source code' folder to the 'compiled' folder. It is not a elegant solution at all since, every time I change something (and I do often) to my controls I have to remember