delphi

Can I hold any data members in abstract base class?

I have an abstract class: type TInterfaceMethod = class abstract public destructor Destroy; virtual; abstract; function GetBasePlan: Word; virtual; abstract; procedure CountBasePlan; virtual; abstract; procedure Calculate; virtual; abstract; procedure PrepareForWork; virtual; abstract; end; ...

Why is CharInSet faster than Case statement?

I'm perplexed. At CodeRage today, Marco Cantu said that CharInSet was slow and I should try a Case statement instead. I did so in my parser and then checked with AQTime what the speedup was. I found the Case statement to be much slower. 4,894,539 executions of: while not CharInSet (P^, [' ', #10,#13, #0]) do inc(P); was timed at 0...

How can I print different bands depending on the value of a Field in a DataSet using FastReport?

I have a product's dataset and I want to have distinct bands for each type of product, something like, if the product is a fruit, print it's weight, if the product is a car print its color and so on. And I want to let my users customize it, so each band for each type o product will be perfect. My DataSet have all fields from all type o...

Playing mp3 with delphi

Which component to use to play mp3 files from streams/files and also to know the lenght in seconds of that mp3 stream? ...

Is there a program to decompile Delphi?

Someone just sent me a decompile of a program into C. It was a very good decompile, producing nice, mostly readabe C code (if you overlook the fact that none of the variables or functions had a human-readable name) that mostly looked like it would actually compile. There was one big problem, though. I happen to know that the program h...

View position in DBGrid when scrolling in Delphi.

I have a DBGrid on a form. The DBGrid has many columns, so an horizontal scroller is displayed. I scroll the DBGrid view to the right to see more columns. If I select a row, the DBGrid view is automatically reset to view the first column (As if I scroll back to the left most position). Is there a way to prevent that? ...

How do integrate Delphi with Active Directory?

We need to validate an user on Microsoft's Active Directory using Delphi 7, what is the best way to do that? We can have two scenarios: the user inputs its network username and password, where the username may include the domain, and we check on active directory if it is a valid, active user. Or we get the current logged user from Windo...

What's the simplest way to override a Delphi property's default value?

I'm trying to write a TCustomDBGrid descendant that's designed to feel like a TListBox. One of the things I want to change is the Options property's defaults. TCustomDBGrid defines Options as: property Options: TDBGridOptions read FOptions write SetOptions default [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRo...

Delphi RTTI trouble: GetPropInfo returns nil with {$METHODINFO ON}!?

Is there any possibility that GetPropInfo returns nil even if the given class is declared with correct {$METHODINFO} directives. type ... ... {$METHODINFO ON} TMyClass = class private fField: integer; published property Field: integer read fField write fField; end; {$METHODINFO OFF} ... .....

Delphi Short Cut to add Date and Name Comment

Does anyone know of a short cut to place my name and the date where the cursor is i.e. //021208 DarkAxi0m so i don't keep check what the date is when i'm adding comments. Im using Delphi7, with CnPack And GExperts Installed. I think it should be able to be done with one of those experts. ...

Is it possible to access a 64-bit dll from a 32-bit application?

I have a Delphi application similar to Taskbar Shuffle that includes a hook dll. EDIT: This hook DLL communicates with the main app by sending windows messages. I want to add support to XP and Vista x64 and my initial idea was to convert the dll to 64-bit (compiling it with FreePascal) but keep the application 32-bit for now (Delphi). ...

Which is the best method to save data in Delphi

I work on a program in Delphi that holds a lot of data, and I wonder which method is the best to save it to file. Now we use records and "file of" to save it but I think it should be better methods. I would prefer a system that makes it easy to migrate from the system we use now. EDIT: The application is a sort of a database application...

Why I cannot just call INHERITED?

Hi. This works: constructor TMyObj.Create; begin inherited; end; Why this is not working also? function TMyObjEx.Import(CONST FileName: string; CONST x, y, z: Integer): string; begin result:= inherited; // Import(FileName, x, y, z); <--- Compiler says: "incompatible types" //do other stuff here end; Declaration of TMyObjEx is...

Can I use Delphi or C++Builder for Windows Mobile 6.1 Development?

I'm curious about what it takes to program for mobile devices (Windows Mobile 6.1) and if I can use the IDE's we're already used to (RAD Studio 2009). Is there a Mobile Development Community around where Delphi or C++Builder users can learn from? Are there differences in development techniques, like: Drivers, Memory Limits, Device ...

Converting Integer value into AnsiString in Delphi 2009

IntToStr() function returns string which is Unicode now. I want converting to AnsiString. Can I use AnsiString(IntToStr(I)) safely? ...

Can I access the string returned from a Delphi CreateProcess command?

I'm using the Win32 CreateProcess function to perform a call to an external executable. The executable returns a string. Is there a way I can capture and interrogate the returned string after calling the executable? Failing that, I might have to write out the string to a file in the executable and read that in the calling program afte...

How to prevent Delphi ADO from loading the entire table into memory?

hi I am not a Delphi programmer, but I I got an old Delphi 7 application that I need to fix and it is using ADO. The database table (MS Accesss) contains +100,000 rows and when I set the ADOTable.Active=true it starts to load the entire table into RAM and that takes a lot of memory and time. How can I prevent ADO to load the entire ta...

How do I write a DLL for Excel in Delphi?

I'm using Turbo Delphi 2006. The DLL will be called from within Excel as part of a VBA/DLL combination. The first part of the problem is trying to find out how to pass to the DLL a reference to the current Excel session. Most other code I've seen has you launching a separate instance of Excel apart from the one you're in. I've seen s...

Is it possible to log the SQL queries between a Delphi app and a MsAccess DB?

Hi I have a Delphi 7 app using ADO/MSDASQL.1 provider and I wonder if it is possible to "log" the SQL queries sent to the DB in a easy way? Just like the SQL profiler in SQL Server? //Andy ...

The 'invalid field type' error with TClientDataSets I don't understand

Hi I use nested database stuctures with TClientDataSets. I'm new to programming so my lingo is ten-to-one wrong. My problem is as follows: I defined my database stucture and all the fields of the nested stuctures and then I called the CreatDataSet method of the master clientDataSet and it worked. I then wanted to add another data fiel...