Saving list box values to the registry


Hi , whats the best way to save a list boxes values to the registry. I know I could cycle through each one, but i think there's a better way. Any ideas Cheers, Paul...
Posted On: Saturday 10th of November 2012 08:37:41 AM Total Views:  94
View Complete with Replies

RELATED TOPICS OF Delphi Programming PROGRAMMING LANGUAGE




bug with sorting of Stringlist - Delphi 5 to 2007

Hi , There is a bug with sorting of Stringlist in - Delphi 5 to 2007. Below '(I)' is fine. But in (II) After including tag '0' or '1' in the least significant position the order changes for RAJ-PATIL. (I) - Sorted results of Stringlist items C:\AF_2_0001F00.TXT C:\DELIT\RAJ1.TXT C:\DELIT\RAJ1.TXT C:\DELIT\RAJ2.TXT C:\DELIT\RAJ2.TXT C:\DELIT\RAJRAJPATIL.DOC C:\DELIT\RAJRAJPATIL.DOC C:\DELIT\RAJRAJ-PATIL.DOC C:\DELIT\RAJRAJ-PATIL.DOC (II) - Sorted Results of Stringlist items C:\AF_2_0001F00.TXT0 C:\DELIT\RAJ1.TXT0 C:\DELIT\RAJ1.TXT1 C:\DELIT\RAJ2.TXT0 C:\DELIT\RAJ2.TXT1 C:\DELIT\RAJRAJPATIL.DOC0 C:\DELIT\RAJRAJ-PATIL.DOC0 C:\DELIT\RAJRAJPATIL.DOC1 C:\DELIT\RAJRAJ-PATIL.DOC1
VIEWS ON THIS POST

135

Posted on:

Wednesday 26th September 2012
View Replies!

Get a list of disk drives

D7, WinXP How do I get a list of disk drives that are on the system and determine if they are ready
VIEWS ON THIS POST

50

Posted on:

Wednesday 26th September 2012
View Replies!

Column hilighting memo or listbox

I've a bunch of Intel Hex files to work with - they have a particular format, and it would be handy to view the hex data with the first 10 columns having special hilighting. That is, colum1 no hilight, cols2,3=color1, cols4,5,6,7=color2 etc. Is there a simple way to add column hilighting to a memo (or even a listbox) TIA. Cheers, EdB
VIEWS ON THIS POST

50

Posted on:

Wednesday 26th September 2012
View Replies!

Please listen to the reviews...

http://www.theregister.co.uk/2008/06..._php_2_review/ What I take away from this review is that Delphi for PHP 2 was released early, the documentation isn't enough, and the samples/demo projects aren't explanatory enough. That same summary went for JBuilder 2008. Please, please, please make Delphi's next release the one that bucks the trend. -- -Brion There's no such thing as 'one, true way;' - Mercedes Lackey
VIEWS ON THIS POST

57

Posted on:

Wednesday 26th September 2012
View Replies!

Havingn multiple image lists attached to a TActionManager?

I need some of my images to be large (for the toolbars) and some to be small (for the menus). Is it possible to have that using the TActionManager or should I assign different image lists to different controls
VIEWS ON THIS POST

49

Posted on:

Friday 28th September 2012
View Replies!

imagelists vs resource files

Just a (hopefully) simple question; I've got a situation where I need to have about 100 glyphs, of varying sizes, available to one of my existing applications. Previously, the projects has had maybe a dozen such glyphs; I just used 2 imagelists (one for small glyphs, one for larger glyphs) on the main form of the program, and had no problems just 'assigning' graphics into TImages on other forms, etc. This time around, not only will there be several imagelists (I have glyphs at 3 different sizes), but I'm worried that managing them in Delphi's TImageList editor will be awkward, and most importantly from a maintenance and version control point of view - the .dfm will become huge! So I thought I should put the images into a resource file, to become compiled into the exe, and then just 'load' them from the resource as I need them at runtime. Are there any pitfalls of doing this that I should be aware of It *looks* fairly simple to just convert my calls from (eg) frmMain.imgMedGlyphs.GetBitmap(MED_GLYPH_CHECK, imgCheck.Picture.Bitmap); to imgCheck.Picture.Bitmap.Handle:=LoadBitmap(hInstance, 'med_glyph_check'); Is there anything to be gained from leaving everything as it is and just dynamically loading-up the TImageList from the embedded resources when the program first starts Any thoughts or comments appreciated - I've never had quite so many graphic resources in a program before and I'm quite sure that just persevering with a huge .dfm and reams of TImageLists is the *wrong* way to proceed! Cheers Rob
VIEWS ON THIS POST

74

Posted on:

Saturday 29th September 2012
View Replies!

multi-threading + stringlist

, i've the following issue with my delphi app. i receive data from a soap interface. i put this data into a stringlist. (asynchronous then and multithreading) i ve a thread that (is trying to) handle(s) the stringlist. when a item is processed, i delete it from the stringlist and i process the next one. then the stringlist is filled and processed "at the same time". my application crashes when i delete the object. i made critical section and the problem is not solved. i read documentation on the web but nothing helpful for the moment. Do you have some hints/ideas for me
VIEWS ON THIS POST

58

Posted on:

Sunday 30th September 2012
View Replies!

Delphi wish list

Some thoughts about directions and marketing of Delphi post sale to Embarcadero: 1. Marketing focus. Delphi should be marketed as "one of the best and most productive general-purpose programming languages", not as a GUI or database front end builder, even though the latter spin may fit better with Embarcadero's product range. I quote from the introduction to Jon Shemitz' "NET 2.0 for. Delphi Programmers": "It's rough being a Delphi programmer. We know we have a wonderful, productive environment- but jobs are few and far between. We know that we can write any sort of application with Delphi-yet Delphi is seen as a GUI builder and a database front-end." This perception can only be due to misguided marketing spin in the past. The risk is that the acquisition by Embarcadero will make the marketing focus even more biased towards database applications, rather than tell the story as it ought to be told - Delphi is a powerful, efficient, at core reliable, high level, potentially cross platform, algorithmic compiled language, as good, if not better than C++, Java, C#, etc. Are these other development languages marketed primarily as GUI and database front-end builders No. Can they also be used to build GUI's and database front ends Yes. With the wrong marketing spin, if we see any new books at all about Delphi in the bookshops, they will as likely as not be languishing in the Database shelves. 2. Simplicity and reliability should be primary ongoing design goals of Delphi. The original Pascal language was designed to be powerful, well-suited to expressing data structures and algorithms in a human-readable form, reliable, yet at the same time considerably simpler than its Algol precursor. It was very sparing of high level composite features when tasks could be accomplished by a small number of elementary features. Certain features considered at the time to be powerful tools in the armoury of a skilled programmer, like the Goto statement, were spurned because of their adverse reliability implications. A data structure or procedure that does just one thing well is intrinsically more reliable than a class framework having dozens of properties and methods than may interact in an undocumented, and possibly undocumentable, manner. Simplicity also means exposing functionality through static data types and global procedures rather than classes, when the procedural approach suffices. It doesn't however preclude conversions between static and reference types by boxing/unboxing etc. Simplicity means minimising the use of overloaded methods and procedures - it is much better to use different identifiers for different parameter signatures. It means consistency in formulation. It means implementing (or properly hiding) all inherited abstract virtual methods. I wish to paraphrase an excellent quotation from Bruce Schneier. He is talking about software security, but his words are equally applicable to software reliability. The words in *..* are my substitutions for his original words in (..): "If we can distill our recommendations into a single paradigm, it's one of simplicity. Complexity is the worst enemy of *reliability* (security), and systems that are loaded with features, capabilities, and options are much less *reliable* (secure) than simple systems that do a few things reliably. Clearly *Delphi* (Windows) is, and always will be, a complex *language* (operating) system. But there are things *Codegear* (Microsoft) can do to make even that complex system simpler and more secure. *Codegear* (Microsoft) must focus its programmers on designing *reliable* (secure) software, on building things right the first time." Let me say that the core Delphi language seems to be reliable enough, because it is built on very sound foundations - it's the additions and class frameworks, that often mimic the complexity of Microsoft prototypes, that leave one wondering about what confidence one can have in their reliability. 3. Make available published language and library specifications How can a developer verify whether or not a piece of software is doing what it is supposed to be doing Only if there is an unambiguous specification of its required functionality. This means an EBNF syntax for all language elements, and a clear description of the behaviour/semantics of all operations and class methods. The implementation of how this is achieved is the intellectual property of the vendor - I do not advocate making the compiler open source. What is needed is a clear and complete syntax specification for Delphi, Interbase SQL, and any composite method parameters (e.g. Filter property of TDataset - what is the EBNF syntax of the predicate expression) Bruce Schneier's writings in relation to Windows security issues are also relevant to Delphi. To paraphrase him: "The published specifications must be complete, readable, and generally available. It's not sufficient to make the specifications available to specific researchers, or to people who have signed non-disclosures or paid for the privilege. Again, this is not easy from a business point of view, but if *Codegear* (Microsoft) is serious about putting *reliability* (security) first, it needs to engage rather than ignore the *developer* (security) community." 3. Zero tolerance to quality defects (bugs, documentation gaps and errors, etc). New versions should focus on simplicity, quality and reliability rather than new features. Each new version should prioritise improvements to existing features and bug fixes over the introduction of new features. New features should be included in shipped versions only after the satisfactory completion of a rigorous quality verification process applied to both the code and the documentation. It would be interesting to compare the number of existing Delphi developers that buy a new release of the product attracted by its new features with the number that hold back from buying the new release inhibited by the fear of having to waste time coping with a new crop of bugs or omissions in the documentation, or by knowing that reported bugs or omissions have not been fixed "for reasons of backward compatibility". The tolerance of long-standing bugs recorded in Quality Central but left to persist uncorrected over many releases is again rather reminiscent of Microsoft. I quote from a contributor to Bruce Schneier's blog: "I sat next to a Microsoft coder (and sometime manager) on a flight from Seattle recently. He explained that as long as a coder's bug count was below some level, the bugs could be ignored, and the coder could continue implementing new features. If the bug count crossed the threshold, he would have to stop until it was brought back down -- not to zero, just to the limit. This systematic tolerance for faults of all kinds is why their software is so bad today, and it won't change quickly. Nothing in the press release suggested that they saw security as inextricably connected with reliability. " The excellent Craig Stuntz commented in a recent thread that "Followers of Raymond Chin's writings know that "many of the so-called "bugs" in Windows are an intentional decision to favour backwards compatibility over perfection in future programs. People who want the opposite emphasis can get a Mac." It would be nice if Codegear were to adopt the Mac policy. 4. Cross-platform capability Software, particularly database front ends, is becoming more distributed and web-centred. It is therefore important that Delphi retains and improves its ability to compile high level source code into a variety of different platform codes, including Win32, Linux, and .Net. Clearly there will be some operating system functions and some GUI components that do not have equivalents on multiple platforms, and cannot be included in cross-platform source mode modules. But for the most part, web application servers, SOAP and REST servers, etc. do not and should not use such facilities. These comments are expressed in a spirit of constructive criticism. Long may Delphi prosper! EM
VIEWS ON THIS POST

29

Posted on:

Monday 1st October 2012
View Replies!

How to clean the uses list

During the development of an application I incorporate units to the uses clause Not all of them are required at the end of development and sometimes I forget to remove them. Is there a way or a tool that can point to the unneeded units
VIEWS ON THIS POST

31

Posted on:

Tuesday 2nd October 2012
View Replies!

Stringlist

I have a problem with deleting an item from a stringlist I have a main form with a series of edit boxes which when double clicked launch a modal form with a listbox which loads a list of names from a stringlist which when clicked put the chosen name in the first edit box - repeat for 1 to 5. This works perfectly but I wanted to delete the picked name from the stringlist to eliminate any possibility of it being picked twice. I thought that this worked good but have realised that it only works if the user clicks the first item in the listbox ie the stringlist never gets the number of the itemindex from the list box which do change depending upon the name clicked code I'm using is as follows var i: integer; begin i := 0; // if this is not inialised I get an out of bounds error Labour.ProjectList[i] := lbProjects.Items.Strings[lbProjects.ItemIndex]; //Stringlist on Main form allocated index Labour.ProjectList.Delete(i); end; This compiles and runs OK but as I said the ProjectList[i] is never changed from 0. Whilst I can live with this I would appreciate any help in solving it
VIEWS ON THIS POST

33

Posted on:

Wednesday 3rd October 2012
View Replies!

String in some type of list

I have a list of filenames, and I want to see if the current filename I have matches any of the names in the list. I'm unsure of how to create a TStringList as a constant, can it even be done If not I might have to use an array. But with both an array and TStringList what function/method could I use to see if my current string was in the list. - Dan
VIEWS ON THIS POST

45

Posted on:

Monday 8th October 2012
View Replies!

Maintaining list of interfaces and id's

I need to maintain a list of interfaces based on id's consisting of strings. With objects I would use a TStringList for this. But this won't work with interfaces. I am getting an incompatible types error between TObject and IRoute. Is there a beast like TStringList for interfaces
VIEWS ON THIS POST

37

Posted on:

Tuesday 9th October 2012
View Replies!

Multiple file Replace - printing file list

Hi Env = RAD Studio 2007 I need to update all the files in my project and replace the TBitBtn with TButton. Is there an "easy" way of achieving this If I have to manually open each file, in D6 if you opened the .dpr you could see a list of all the files in the project and then print this list, is there a way in 2007 the .dproj project is no longer listed in the "View Unit" option
VIEWS ON THIS POST

40

Posted on:

Tuesday 9th October 2012
View Replies!

Notification components list ?

Is the list of component to be notified by another within the FreeNotification/RemoveFreeNotification mechanism available as a property DH
VIEWS ON THIS POST

70

Posted on:

Tuesday 9th October 2012
View Replies!

Closing a form without saving and destroying objects

I wrote a component inherited from TPaintBox, and in its BeforeDestruction methods, I planed to call a SaveToFile method to save the component state when its destroyed... That works so that at execution time, I am able to LoadFromFile the state of the component and retrieve parameters the user adjusted. But ! When I open my form in the designer, and I modify some properties, the Designer asks me if I want to save my form. How could I catch the answer (csDesigning is set in thhis case), so that if the user says No, I just dont call my own SaveToFile methods... DH
VIEWS ON THIS POST

37

Posted on:

Wednesday 10th October 2012
View Replies!

Please listen to the reviews...

http://www.theregister.co.uk/2008/06..._php_2_review/ What I take away from this review is that Delphi for PHP 2 was released early, the documentation isn't enough, and the samples/demo projects aren't explanatory enough. That same summary went for JBuilder 2008. Please, please, please make Delphi's next release the one that bucks the trend. -- -Brion There's no such thing as 'one, true way;' - Mercedes Lackey
VIEWS ON THIS POST

48

Posted on:

Tuesday 16th October 2012
View Replies!

Multiple file Replace - printing file list

Hi Env = RAD Studio 2007 I need to update all the files in my project and replace the TBitBtn with TButton. Is there an "easy" way of achieving this If I have to manually open each file, in D6 if you opened the .dpr you could see a list of all the files in the project and then print this list, is there a way in 2007 the .dproj project is no longer listed in the "View Unit" option
VIEWS ON THIS POST

164

Posted on:

Tuesday 16th October 2012
View Replies!

My wishlist of Delphi

I hope Delphi can introduce the mechanism of DynamicProxy, or other ways to help people do with AOP easily. And I also hope Delphi can expansion its variants(or create a new type that support introspection and reflection) to make object more dynamic and flexiable, so that we can create dynamic objects, and then I think Delphi can have ActiveRecords or other ORM libraries.
VIEWS ON THIS POST

30

Posted on:

Tuesday 16th October 2012
View Replies!

bug with sorting of Stringlist - Delphi 5 to 2007

Hi , There is a bug with sorting of Stringlist in - Delphi 5 to 2007. Below '(I)' is fine. But in (II) After including tag '0' or '1' in the least significant position the order changes for RAJ-PATIL. (I) - Sorted results of Stringlist items C:\AF_2_0001F00.TXT C:\DELIT\RAJ1.TXT C:\DELIT\RAJ1.TXT C:\DELIT\RAJ2.TXT C:\DELIT\RAJ2.TXT C:\DELIT\RAJRAJPATIL.DOC C:\DELIT\RAJRAJPATIL.DOC C:\DELIT\RAJRAJ-PATIL.DOC C:\DELIT\RAJRAJ-PATIL.DOC (II) - Sorted Results of Stringlist items C:\AF_2_0001F00.TXT0 C:\DELIT\RAJ1.TXT0 C:\DELIT\RAJ1.TXT1 C:\DELIT\RAJ2.TXT0 C:\DELIT\RAJ2.TXT1 C:\DELIT\RAJRAJPATIL.DOC0 C:\DELIT\RAJRAJ-PATIL.DOC0 C:\DELIT\RAJRAJPATIL.DOC1 C:\DELIT\RAJRAJ-PATIL.DOC1
VIEWS ON THIS POST

106

Posted on:

Tuesday 16th October 2012
View Replies!

String in some type of list

I have a list of filenames, and I want to see if the current filename I have matches any of the names in the list. I'm unsure of how to create a TStringList as a constant, can it even be done If not I might have to use an array. But with both an array and TStringList what function/method could I use to see if my current string was in the list. - Dan
VIEWS ON THIS POST

41

Posted on:

Tuesday 16th October 2012
View Replies!