delphi

How To Subclass A Form in Delphi? Best Practices?

I've got a base form in Delphi 2007 that I'd like to reuse in another project, adding some other buttons and such. I'm familiar with subclassing a non-GUI object, but it is possible to subclass a Form in the same fashion? Can you make changes to the subclass Form in design mode? How do you go about doing this and what are some things ...

MessageBox

In Delphi; what are the differences between Application.MessageBox, Windows.MessageBox or Dialogs.MessageDlg? Or which is more efficient to use computer memory? ...

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...

Make a application retrieve data from MySQL database.

I'm looking to make a application that shows something from a MySQL data base. They should go in Order according to which ever one is next. The user would set a time that the events should happen, along with a Name for it. Then, that information would go intoa a MySQL database and it will be shown along with the other events in the appli...

Saving a Base64 string to disk as a binary using Delphi 2007

I have a Base64 binary string that is part of an XML document that is sent to us by a 3rd party supplier, I would like to be able to save it back to its original file format (jpg). Using the accepted answer from this question "saving a base64 string to disk as a binary using php" I can save the string to a jpg with little effort, so I k...

Convert TDateTime to Another Time Zone Regardless of Local Time Zone

Regardless of what the user's local time zone is set to, using Delphi 2007, I need to determine the time (TDateTime) in the Eastern time zone. How can I do that? Of course, needs to be daylight savings time aware. ...

need help with interesting call to JCL's TEvaluator

i'm using JCL's expression evaluator TEvaluator (a marvelous creation donated by barry kelly). (THANK YOU barry!) background i've used the AddFunc method. function MyFunc:double; begin // calculations here Result:=1; end; you can use the AddFunc method to make the function available: AddFunc('MyFunc', MyFunc); here's t...

How do I handle MS Access transactions in a multi threaded application, and how do I syncronise MS Access and Oracle tables?

I'm in a project to write a program using local database. We use Delphi, MS Access and Oracle. The issue are: There are several threads needed to insert and update MS Access DB. I haven't test it now, and I know access have a multi-thread issue here. Whether I need to use a lock or put MS Access DB operation into on thread? We need...

Universal approach for storing INI-type settings and/or DB files on various Windows machines

OK, true confession first: Maybe it's just me, but sometimes "best practices for program settings" on Windows machines feels like it's changed more than Microsoft's data access strategies. I'm still running XP, and somewhere along the way just kind "glazed over" about where MS wanted me to store all my app's data, etc. I controlled all...

Full VCL Class Browser for Delphi

Remember the old class hierarchy posters that used to come w/Delphi? I'm wanting a full class hierarchy browser for ALL my Delphi classes, including the custom ones I've built and installed on the palette, plus third-party components. Ideally easily searchable by class name (including "whole word only" searches, so partial matches don'...

Component Initialization - Runtime vs. Designtime

I have a series of visual compound components that I'm building, which use similar / common "connect" methods, which fire up there internal tables, etc. I am automating some of the connection stuff to connect automatically at runtime. How do I tell, at the component level, if the current state is runtime or designtime? ...

view pdf in program(delphi) by use free library(not activeX)

Is there are any open source or free-ware library to display PDF file in my Delphi program? I had looked for one, but most of them are commercial or not fully functional. PS: this solution need to be cross platform by using wine. ...

Delphi 2007 (or 2009) build events tied to build configurations ?

Hi, Is it possible to add build events only for a specific build configuration in Delphi 2007 ? I use 2007 but would be interested in what you can do in 2009 also. Cheers Sam ...

Circular reference issue with Classes which use each other

I have the following two classes: TcmTPDataPanel = class(TcmTPBasePanel) Database: TnxDatabase; Session: TnxSession; private FDataConnector: TcmTPDataConnector; MyNxDataBase: TnxDatabase; MyNxSession: TnxSession; MyRefNxDataBase: TnxDatabase; protected procedure Disconnect; virtual; abstract; procedur...

How to Detect that the Mouse is unmoved and button still pressed?

In Delphi, I've added a Scrollbar component (oriented vertical) to the right side of my form. I've added a Scrollbar OnChange event so I can change the view of the form and the position of the scrollbar thumb when the user clicks on the UpArrow or DownArrow button with his mouse, and this works fine. But the OnChange event only seems t...

How to create virtual file in Delphi app

I had a previous post on how to make memorystream play in wmp activex and got a reply with a link to boxedapp sdk. It's not a freeware so I studied the process and I figured out that it is using a virtual file for the stream to be saved and that its filename is used as the URL. So, my question is how to create a virtual file that returns...

A question about Progress Bars and Delphi.

I'm trying to make a progress bar that starts at 0%, and takes 5 seconds to get to 100%. The progress bar will begin to go up as soon as Button1 is clicked. Any advice? I looked on Google, but that gave me nothing good on this sort of thing. Also, at 0%, there should be a label that says "Waiting...", when the progress bar starts, it sh...

Avoiding casting when passing objects through library code (In Delphi)

When designing libraries, I often end up resorting to the following pattern, which I don't like as it results in lots of type-casting. The basic pattern is: The code using the library hands an object to the library, the library then hands the object back to the calling code. The calling code is forced to cast the object, as the library ...

C++ Builder [C++ Error] sysmac.h(58): E2040 Declaration terminated incorrectly

I want to create a C++ Builder DLL project that doesn't use VCL. But I get this error in sysmac. Does anyone know the possible cause of this error? ...

how to quickly verify the case sensitive filename really exists

I have to make a unix compatible windows delphi routine that confirms if a file name exists in filesystem exactly in same CaSe as wanted, e.g. "John.txt" is there, not "john.txt". If I check "FileExists('john.txt')" its always true for John.txt and JOHN.TXT due windows . How can I create "FileExistsCaseSensitive(myfile)" function to co...