delphi-2009

Hide the Main Form in a Delphi 2009 Application

Hi, The following code works fine in Delphi 7. However, in Delphi 2009 the form does remain hidden but the button on the taskbar is now appearing. ShowWindow(Handle, SW_HIDE); SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW ); ShowWindow(Handle, SW_SHOW); The above code is called in the FormC...

Delphi - Tree View

Hi I am looking for a data aware Tree View for delphi what is the best one to use ? ...

Delphi silently cropping string literals

Delphi 2009 Win32. The code below tries to add a 257 length string to a memo. It compiles and runs fine, but nothing is added to the memo. Memo1.Lines.Add('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

ThreadPool, QueueUserWorkItem and Deadlock on Shutdown

I just implemented a thread pool like described here Allen Bauer on thread pools Very simple implementation, works fine, but my application no longer shuts down. Seems that two worker threads (and one other thread, I guess the queuing thread) stuck in the function ntdll.ZwRemoveIoCompletion I remember to have read something about IO...

Compare Function and Multithreading

Assume a multi-threaded environment and a (properly synchronized) class that has one particular procedure procedure SortKeyList (KeyList : TList <Integer>; Inverted : Boolean); that takes a list of keys and sorts it. The procedure uses the RTL quicksort implementation TList.Sort: KeyList.Sort (TComparer <Integer>.Construct (CompareKe...

Byte size of object including size of members

I want to know (for debugging and logging) the size of an object in bytes, but not like Sizeof (Object) but like a 'deep sizeof'. For example if the object contains a hash map or a list, the real size needed by that hash map or list should be added to the result. Is there any way to do this without having to add a property Size : Lon...

How does the Delphi 2009 compiler handle recursive inline methods?

Do "What's wrong with using inline functions" and "Can a recursive function be inline" apply to Delphi inline functions? Furthermore, does anyone know how recursive inline functions are handled in Delphi? ...

Delphi 2009 - Custom Enum type property in the Object Inspector

Hi, I have created a custom TAction type which has 2 additional properties which are of type string, and enumeration. The string value is showing in the object inspector fine, however, the enumeration type is not appearing at all. How can I get a custom enumeration type to display as a drop down property value in the object inspector? ...

Converting TMemoryStream to String in Delphi 2009

We had the following code previous to Delphi 2009: function MemoryStreamToString(M: TMemoryStream): String; var NewCapacity: Longint; begin if (M.Size = 0) or (M.Memory = nil) then Result:= '' else begin if TMemoryStreamProtected(M).Capacity = M.Size then begin NewCapacity:= M.Size+1; TMemoryStreamProtec...

How Delphi 2009 converts Delphi 7 projects re build configurations

I'm moving frequently between D7 and D2009 with library code that works with both. For ease of going both ways, I'm routinely deleting all the D2009 additional files that get created, eg *.dproj etc such that on entry to D2009 I'm only ever taking D7 files. This is nice because D2009 automatically makes a *.dproj, *.dgroup etc and apart ...

first chance exception: system error 8: not enough storage space to perform the command

how do i debug something like this? i need the debugger to stop and show me where the problem is. don't just show it in the event log & then hang. first chance exception: system error 8: not enough storage space to perform the command i'm using delphi 2009. the problem doesn't happen regulary. i'm not eager to pepper my program w...

Can a WSDL indicate the SOAP version (1.1 or 1.2) of the web service?

Delphi only supports SOAP 1.1, and includes a WSDL importer. Is there a 'litmus test' to see if a web service uses SOAP 1.1 or 1.2, based on the information in the WSDL? ...

Excel type library / Delphi 2009/ bad variable type

We have just updated an application which uses the Excel type library to Delphi 2009 from Delphi 2006. What I am finding is that nearly nothing now works - nearly any call to Excel results in a message "Bad variable type.". For example we may do: Sheet.Cells.Item[Row, Column].Value := Value where Sheet is an ExcelWorksheet and Value is a...

how can i hide TRibbon pages?

i'm using delphi 2009's TRibbon component. certain pages are not relevant depending on the application state. how can i hide a TRibbon page? RibbonPage1.Visible:=false doesn't really hide the page... is this maybe not allowed by the spec from microsoft? thank you for you help! mp ...

How can i create a new instance of a class?

i have a list of class instances of various kinds. i need to be able to create a new instance of a class without knowing for sure what to create. all the objects involved have the same ancestor. the actual copying of the object's member variables is easy...it's the creation of the new object where i have a problem. admittedly i could...

Delphi: Required package not found

I'm trying to build 3 packages, A, B and C. A defines some base classes that are used in B and C. I've got all 3 of them in the same project group, all set up to output to the same custom BPL output folder. This folder is in the search path for B and C. But when I go to build B and C, the compiler chokes on the Requires list. "Requir...

Delphi Coding Standards

I am in the process of writing (down) our companies coding standards for Delphi programming, so what would anyone suggest to have as a basis, anything that you would recommend to use / not use ? ...

COM server AnsiString parameters in Delphi 2009

I have a simple COM dll with a method that takes two strings. In the type library editor of delphi these strings are defined as LPSTR. This translates to PChar in the TLB file. When upgrading from D2007 to D2009 this became a problem since PChar now has changed from PAnsiChar to PWideChar (it still becomes PChar in the TLB file when it i...

How can I change the orientation of the label on a TPageControl?

I'm new to Delphi (again - I used Delphi back in 1994). I now have Delphi 2009 Pro. Coming from Java, I find the object inheritance very obscure. My users want tabbed pages with the tabs on the left. But, the TPageControl doesn't allow the tab label direction or orientation to be changed. They want the words on the tabs to read to...

Is It Time To Rethink The Delphi Help File System?

The majority of components available for Delphi do not have HTML Help files for Delphi 2009. Many components including some very popular commercial components only have HLP and CHM help files. Many of the third-party components are no longer being actively developed but are used by many developers. As a result there is no IDE help for...