delphi

How to access functions in child classes?

A child class can access protected functions in parent class,but the parent class can't access protected functions in child class. I'd like to keep both classes as private as possible.The parent class is a form and only once instance is used.All functions in the child class are static,it inherits from the parent class. How is it possib...

Increasing a pointer not compiling the way I had planned

Hello, I tried to make my code as simple as possible,but I failed at it. This is my code: class function TWS.WinsockSend(s:integer;buffer:pointer;size:word):boolean; begin dwError := Send(s,buffer,size,0); // Debug if(dwError = SOCKET_ERROR) then begin dwError := WSAGetLastError; CloseSocket(s); WSACleanup; case ...

What's the best method for getting the local computer name in Delphi

The code needs to be compatible with D2007 and D2009. My Answer: Thanks to everyone who answered, I've gone with: function ComputerName : String; var buffer: array[0..255] of char; size: dword; begin size := 256; if GetComputerName(buffer, size) then Result := buffer else Result := '' end; ...

Using ClearType in Graphics32 library (Delphi)

I'm using Graphics32 library in Delphi 2009. Is it possible to render a font using TBitmap32.TextOut method with MS' ClearType technology? I'm aware about GR32's built-in antialiasing (TBitmap32.RenderText) but the overall quality and performance is not gratifying. [ Update ] I've encountered another problem - I'm using function from T...

Is Inheriting nested classes possible?

Well,I have a parent class with a nested class declared in the "protected" tab with a protected class variable.In another unit I have a child class,which inherits from the parent class.When I try to access something protected/public from the parent class -it works,but when I try to access something protected from the nested class,it does...

File Does Not Begin With '%PDF-'

I had a peculiar problem yesterday. A customer put one of my Delphi apps on some Toshiba laptops, and all was fine until it was time to generate some Acrobat files as a Rave 7 report, which produced the subject error. The laptops had Acrobat 7 Standard installed with XP SP3 and IE8. I uninstalled Acrobat 7 Standard, put in Acrobat 5 R...

[MDI] Child form to use whole client area?

Hello I'd like to show an MDI child window that will use the whole client area, ie. the grey part no the right-side of the taskpane, and have the child window show its titlebar and borders: http://img149.imageshack.us/img149/3204/delphimdichildwindowwit.jpg Here's the code, which doesn't work as planned: procedure TForm1.RzGroup1Item...

With Delphi are you more likely to re-use temporary variables than with other languages?

Since Delphi makes you go all the way up to the var section of a method to declare a local variable, do you find yourself breaking "Curly's Law" (re-using variables) more often than you did in college?(unless of course, you programmed Pascal in college). If so, what do you do to break yourself of that habit, especially in functions wher...

Delphi - Inherit / Override a constant array?

Firstly, an apology for the length of this post. If brevity is the soul of wit, then this is a witless question. I think my question boils down to: What is the best way to override a constant array in Delphi child classes? Background: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- I have a constant array that is defin...

A better way of passing parameters to a TADOStoredProc (Delphi)

Hi, I am needing to convert a large amount of SQL queries into stored procedures. I have some code that updates about 20 or 30 values at one time in one Delphi procedure. I can handle creating a stored procedures to do such a thing. The problem is my way to pass parameters to stored procedures is very bulky like this: with stored_pr...

Delphi 2009 only halts at breakpoints in one unit

Hello, I'm experiencing problems with debugging in Delphi 2009's IDE. Since having moved old projects that had been created using Delphi 7 to this version, all breakpoints except for those in one unit are neglected. I couldn't figure out which unit that is, but that seems to change from time to time. Enabling debug DCU's overcomes this...

Should I use block identifiers ("end;") in my code?

Code Complete says it is good practice to always use block identifiers, both for clarity and as a defensive measure. Since reading that book, I've been doing that religiously. Sometimes it seems excessive though, as in the case below. Is Steve McConnell right to insist on always using block identifiers? Which of these would you use? ...

Older Delphi Instructional Materials

There's a lot of old Delphi books available inexpensively. As a self-taught (advanced) beginner, it is difficult for me to know which ideas are still relevant and up-to-date, and which have become outdated. I'm hoping for a little guidance. For example, would it be outmoded to learn about databases powered by BDE? Is COM no longer a comm...

How to access the member of a class(created in c#) in dephi

I have created a lib which contains DateRange class in c#. I have created .dll and .tlb for that lib and registered the .tlb file. All the necessary steps has been done. In Delphi, i used import type library option to produce a unit which contain the information of all classes which i created in c#. Problem: I dont know how to use the...

TServerSocket: Confusion with Socket Objects

So I'm having this application that verifies weather a user can log-in or not. It consists of multiple Clients (up to 200) and a server that processes the login querys (containing Username, PW and IP). The Server checks weather the user exists and sends an answer back. TLoginQuery is a Record. procedure TLogin_Form.btnLoginClick(Sende...

Delphi constant bitwise expressions

Probably a stupid question, but it's an idle curiosity for me. I've got a bit of Delphi code that looks like this; const KeyRepeatBit = 30; ... // if bit 30 of lParam is set, mark this message as handled if (Msg.lParam and (1 shl KeyRepeatBit) > 0) then Handled:=true; ... (the purpose of the code isn't really important) ...

what is use of inline keyword in delphi

can any one please say what is use of inline keyword in delphi ...

Standalone DBExpress connection editor (Delphi 2009)

is there a free standalone editor for DBExpress connections (Delphi 2009) that can be installed on a customer PC and be used to manage DBExpress connections and (if available) drivers? ...

Delphi: How to use all units and unit references of one project in another project

I am building a dedicated project for all the unit tests of our main project, since including them in the main project would put a strain on an already huge codebase. Now all the units of the main project are referenced in the project's dpr file with their locations. When I write a testcase for a class I simply copy the classes unit refe...

Robust method for making a copy of a TRemotable object in Delphi 2007

Is there a robust mechanism for making a copy of TRemotable object (or descendant) in Delphi 2007? I'm creating a Delphi web service client that receives a variety of objects from a web service; of course, all are descendants of TRemotable. In the client, I create a matching object, then copy all the properties from the web service pro...