delphi-2010

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

How can you tell if a TJvDockServer Form is unpinned or pinned?

独自空忆成欢 提交于 2020-01-05 05:55:25
问题 I was just wondering if anybody knew how to determine if a TJvDockServer Form is pinned or unpinned easily. The only way I've been able to do so is by checking if a parent form is a TJvDockVSPopupPanel via... ancestor := GetAncestors(Self, 3); if (ancestor is TJvDockTabHostForm) then if ancestor.Parent <> nil then begin if ancestor.Parent is TJvDockVSPopupPanel then begin // Code here end; end; and getAncestors is... function GetAncestors(Control : TControl; AncestorLevel : integer) :

Delphi 2010 - Decode Base64 encoded image from XML doc

让人想犯罪 __ 提交于 2020-01-04 04:07:08
问题 I am trying to decode a base64 encoded EMF image from an XML document in my application and render it on screen, however, it never seems to appear. If I copy/paste the data from the XML document into Notepad++ and use the Base64 Decode option and save the file as a .emf it opens fine in mspaint. So I think the issue is how I am decoding it. I have tried the following decode methods described in these articles: How to encode / decode Base 64 string http://www.swissdelphicenter.ch/torry

tfs integration with delphi 2010

a 夏天 提交于 2020-01-03 02:29:12
问题 We are currently upgrading from Delphi 7 to Delphi 2010. With Delphi 7 we use Source Connection to integrate Delphi 7 with TFS, but there does not look like there is going to be a Delphi 2010 version in time. Is there any other integration option out there? 回答1: VssConneXion is not ready for Delphi 2010 yet (there is a version for Delphi 2009 on their downloads page). Currently, I'm running the (Microsoft) Team Explorer for managing my source code check-out/check-in and work-items. It works

Delphi 2010 DeHL Serialization XML and custom attribute : how it work?

落爺英雄遲暮 提交于 2020-01-02 21:47:12
问题 I try to investigate DeHL with Delphi 2010 custom attribute and I get problem. TAppParamTest = class public User: string; Password: string; end; TAppParam = class private FTest: TAppParamTest; public constructor Create; destructor Destroy; override; property Test: TAppParamTest read FTest write FTest; end; this works well : when I serialize I have this <TAppParam xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:DeHL="http://alex.ciobanu

Generic defined in unit breaking debug information

冷暖自知 提交于 2020-01-02 04:52:08
问题 This must be a Delphi bug... I have a unit which is the basis of my persistance framework. In that unit I have a base class for all my domain objects, a list class and a generic list class. Just recently I noticed that when I step into the unit when debugging, execution will jump to a point a little further down in the file than it should... Maybe four or five lines. Re-ordering the file makes no difference. The code would also generate access violations, but only when I debugged it. I cast

Delphi 2010 Control Flickering

*爱你&永不变心* 提交于 2020-01-01 10:53:57
问题 I have been upgrading or migrating our software from XP OS to be able to compile and run under Windows 7. Our software is starting to show issues that we didn't notice under Windows XP. Currently, I am dealing with a user defined control flickering on a TForm. It seems to flicker every now and then not always, but when it flickers it is very noticeable. I have set DoubleBuffered for the TForm and TTrendChart Class, but it is not helping. This a user-defined control of TCustomPanel. It is

Writing a string to a TFileStream in Delphi 2010

烈酒焚心 提交于 2020-01-01 01:59:09
问题 I have Delphi 2007 code that looks like this: procedure WriteString(Stream: TFileStream; var SourceBuffer: PChar; s: string); begin StrPCopy(SourceBuffer,s); Stream.Write(SourceBuffer[0], StrLen(SourceBuffer)); end; I call it like this: var SourceBuffer : PChar; MyFile: TFileStream; .... SourceBuffer := StrAlloc(1024); MyFile := TFileStream.Create('MyFile.txt',fmCreate); WriteString(MyFile,SourceBuffer,'Some Text'); .... This worked in Delphi 2007, but it gives me a lot of junk characters in

Any tool to suggest unit reference automatically for Delphi 2010?

最后都变了- 提交于 2019-12-31 19:28:10
问题 MS Visual Studio has a great feature: it automatically suggests the units to add in using clause when you typing the code with refrences to absent standard classes. Is there any 3-rd party tool to implement similar feature for Delphi? I'm tired to add all those SysUtils, Windows, Messages etc in each new unit. 回答1: If the unit which contains the reference is not yet in the uses list, this is how I save many manual steps: right-click on the underlined (error-insighted) text choose “Refactoring