delphi-2009

Application.Restore does not get me to where I was before, why?

北慕城南 提交于 2019-12-06 09:30:56
The application I am now trying to support ( a former creation of mine ) is a complete mess, and so I programmed an extension to it as a separate executable which I then launch, call application.minimize; and WaitForSingleObject (the recently created process). Right after that I call application.restore to get me back to where I left off. application.Minimize; WaitForSingleObject(ProcInfo.hProcess, INFINITE); Application.Restore; Application.BringToFront; BringToFront; //the topmost form which was used to launch the app Show; I can then see (Win XP), how to describe it?, the frame of the app

delphi opensoure xml writer & reader [closed]

人走茶凉 提交于 2019-12-06 07:57:07
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . could you recommend a good XML open source writer and reader, to generate and read XMLs? 回答1: NativeXml and OmniXML are open source and popular XML libraries for Delphi. ADOM is another, it is included in some versions of Delphi. For some advanced use cases, libxml with the Delphi wrapper Libxml2 might be

Threaded loading of icons in Delphi

淺唱寂寞╮ 提交于 2019-12-06 07:18:23
问题 Using Delphi 2009, trying to make a launcher. In order to make it "snappy" I would really like to load icons in a background thread. I have used the solution found here : Can 48x48 or 64x64 icons be obtained from the Vista Shell? This works fine, if NOT run in a thread. As soon as I put it in a thread, some icons are not "fetched", or being some kind of generic icon. I even tried serializing the threads (making them obsolote, in effect) but it yields the same results. So, the question is: How

Delphi TClientSocket replacement using winsock2 and IOCP?

。_饼干妹妹 提交于 2019-12-06 06:58:06
Is there such a thing? It needs to be asynchronous (no Indy). Try HPScktSrvr - http://www.torry.net/pages.php?id=220#939383 These may or may not be what you are looking for, but worth a shot: Ararat Synapse - For Delphi 2009 support you need to get the latest from SVN. /n Software's IP*Works - Commercial, but very full featured. Good luck! Check http://voipobjects.com/index.php?page=delphi-iocp-library It is migrated iocpclasses.sourceforge.net (i'm an author). Enjoy :) 来源: https://stackoverflow.com/questions/1072510/delphi-tclientsocket-replacement-using-winsock2-and-iocp

Run Firebird query in a background thread and save result set

拈花ヽ惹草 提交于 2019-12-06 06:49:51
问题 i want to put the execution of a query with parameters into a thread-safe class in delphi-2009. I navigate in google but i don't found just what I wanted. Thanks 回答1: I have found that most database API's are only thread safe at the connection level. Firebird may be different, but using InterBase several (8+) years ago, it was not thread safe. Update: I have verified Firebird is only thread safe at the connection level. This means that typically you need to avoid using a single connection

TObjectList<T>.Contains causes Access Violation in Delphi 2009

夙愿已清 提交于 2019-12-06 06:33:43
In Delphi 2009, I had no major problems with Generics so far (using Generics.Collections lists, with no special Generics features). Now I found this code will cause an AV in the line which accesses MyList.Contains . The error disappears if I declare TMyList = class(TList<TMyEntry>) ; Should I avoid TObjectList<T> or is something else in my code causing this error? type TMyEntry = class(TStringlist); TMyList = class(TObjectList<TMyEntry>); procedure TListTests.TestAV; var Entry: TMyEntry; MyList: TMyList; begin MyList := TMyList.Create; try Entry := TMyEntry.Create; MyList.Add(Entry); Assert

Delphi 2009 ShellTreeView/ShellListView Fix

不问归期 提交于 2019-12-06 03:53:46
When a Delphi 2009 project is closed with ShellTreeView/ShellListView on the mainform in the IDE Index out of bounds(0) exceptions are generated. Is there a fix for ShellTreeView/ShellListView so the exceptions can be eliminated? That's the first I've heard of this. If it's any consolation I can reproduce it here. The first thing you should do is probably file a bug report in Quality Central , and ask on the Codegear NNTP Newsgroups. Also, try changing TCustomShellListView.GetFolder to the code below, and see how you get on. You'll need to rebuild the package - and beware that for some reason

Debugging OutputDebugString calls in Delphi

时光怂恿深爱的人放手 提交于 2019-12-06 03:38:37
问题 I've some "rogue" OutputDebugString call in my application which prints out "T", but I can't just locate it. Is it possible somehow to set breakpoint on OutputDebugString -function and see where it is called from? I'm using Delphi 2009. 回答1: How many calls to OutputDebugString are there in your project? You can use the "Find in Files" dialog to find them all, and if they aren't too many, there shouldn't be a problem. Otherwise, you could - of course - use a search and replace and replace all

Size of generic type

房东的猫 提交于 2019-12-06 02:57:18
Is there any way to determine the size in bytes of something like TItem <T> = record Data : T; end; Can I write something like function TItem <T>.GetByteSize : Integer; begin if (T = String) then Result := GetStringByteSize (Data as String) else Result := SizeOf (Data); end; or perhaps with the help of specialization? function TItem <String>.GetByteSize : Integer; begin Result := GetStringByteSize (Data) end; function TItem <T>.GetByteSize : Integer; begin Result := SizeOf (Data); end; Thanks! Is there something wrong with taking the size of the instantiated type? SizeOf(TItem<string>) Or you

creating a gif animated file in delphi 2009?

◇◆丶佛笑我妖孽 提交于 2019-12-06 02:09:13
问题 gif := TgifImage.Create; gif.Width := 100; gif.Height := 100; gif.AnimationSpeed := 500; gif.Animate := true; gif.add(image1.Picture.Bitmap); gif.add(image2.Picture.Bitmap); gif.add(image3.Picture.Bitmap); gif.SaveToFile('gif.gif'); This loops just once and the speed is not 500? How to make it loop and set the speed? 回答1: Anders Melander, who wrote the original TGIFImage, has the following answer. You need to add a “Netscape Loop” extension block to the first frame of your GIF. The loop block