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...
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 ...
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;
...
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...
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...
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...
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...
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...
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...
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...
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...
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?
...
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...
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...
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...
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)
...
can any one please say what is use of inline keyword in delphi
...
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?
...
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...
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...