Sometimes I write very short assembly functions like
function SeniorBit(Value: LongWord): Integer;
asm
OR EAX,EAX
JZ @@Done
BSR EAX,EAX
INC EAX
@@Done:
end;
that seems to be the best candidates for inlining:
function SeniorBit(Value: LongWord): Integer; inline;
but Delphi compiler does not ...
i have a problem with Delphi 2009 when i am trying to execute rave with massage Access Violation at address 0040DF40 in module 'HDMS.exe" Read of Address 00200050 and another massage list index out of bounds (-1)
this problem happened when i am trying to use the application with windows XP and does not happen with windows NT. what shout...
Hello forum,
Does anybody know how to limit/control the bandwidth of twsocket (client) in ICS components in Delphi? We have a small program that maps a port to squid. The software using ICS components that carries requests from the LAN arrives at one port to the port of squid, and returns the contents back to the originating IP. Can som...
Most of the units I work on rely on a Data Module. One of the most annoying things I come accross is an error message telling me
Module X references another module and cannot be saved until Module Y is loaded.
Now, I'm sure there is a very good reason why CheckNoFixups raises this error while trying to WriteRootStream, and fails t...
Embarcadero just released a whole bunch of neat looking icons that I'd like to use to make my Delphi 7 and 2009 apps look fancier. Is there a setting (or hack) in those IDEs that lets me change the default exe icon?
...
Microsoft already says, in the documentation for GetTickCount, that you could never compare tick counts to check if an interval has passed. e.g.:
Incorrect (pseudo-code):
DWORD endTime = GetTickCount + 10000; //10 s from now
...
if (GetTickCount > endTime)
break;
The above code is bad because it is suceptable to rollover of the ...
i have bit of code that causes an underflow:
var
t1, t2, delta: DWORD:
begin
t1 := 0xffffff00;
t2 := 0x00000037;
delta := (t2 - t1);
The subtraction itself does generate an overflow (underflow), but i don't want Delphi to throw an EIntOverflow exception. So i try disabling the generation of overflow checking code by disa...
A few years ago, in a newsgroup thread, Michael Swindell revealed that there was about 1.75 million single users of Delphi (click Here for the thread).
What is the status today ? Can somebody tell us how the Delphi community evolved? Michael again? Nick? Anybody else?
Question reopened. The OP comment below helps explain the reason why...
I'm trying to use RTTI to add an event handler to a control, that may already have an event handler set. The code looks something like this:
var
prop: TRttiProperty;
val: TValue;
begin
prop := FContext.GetType(MyControl.ClassInfo).GetProperty('OnChange');
val := prop.GetValue(MyControl);
FOldOnChange := val.AsType<TNotifyEvent...
In our report generation application, there's some pretty hefty queries that take a considerable amount of time to run. User feedback up until this point has been basically zip while the server chugs away at their request. I noticed that there's a tab on the ADA Management Utility that shows progress on the query both as percent comple...
Let's say I have a record TQuaternion and a record TVector. Quaternions have some methods with TVector parameters. On the other hand, TVector supports some operations that have TQuaternion parameters.
Knowing that Delphi (Win32) does not allow for forward record declarations, how do I solve this elegantly?
Using classes is not really ...
I currently use madExcept.MailAsSmtpClient to send my bug reports. However a couple of large clients have upgraded to Exchange Server 2007 and we can't get the SMTP support for our app configured (the app runs on individual workstations so the messages aren't all coming from one IP. We can configure an authenticated account in exchange a...
For example I disable runtime two buttons. After I disabled first button it bacame gray, the second - it also became gray. But I do not know how to make the repainting simultaneous! I need something like that:
freeze the Form (disable repainting)
disable first button
disable second button
Enable Form repainting
If someone knows how t...
Regarding TJvRichEdit and Delphi... How?
Load/Save rtf (including text and images - not only .bmp) to/from a file?
Read/Write rtf (including text and images - not only .bmp) to/from Firebird blob field?
Automatically convert screendump pasted from clipboard (Ctrl-V) into .jpg format before it is inserted into the TJvRichEdit rtf?
Gui...
We have a few different programs all compiled together in the same suite, recently we had a bug reported that "The Right Click Shortcut Menu was missing."
So as with any bug I tried to reproduce it and couldn't. No matter what I did the right click menu appeared on my system.
My first guess was that this was an OS issue. We know it work...
I have been away from BCB for over five years, and now I am having a st00pid n00b moment.
I am using BCB, and using a VCL component package for which I have the Delphi source.
I want to comment out a few lines in the Delphi source of the component (to not add a few toolbars in a form's OnCreat()).
So, I comment it out, and the syntax ...
I have a Delphi 2009 application that runs a query over a database using a TADOQuery component. When the query has returned data, I call the TADOQuery's saveToFile procedure, specifying "pfXML" as the format parameter, which obviously saves the data to an XML document. This works fine.
To view the data, I have a screen that contains a v...
Hello!
I'm using the latest indy snapshot (installed yesterday) and newest SSL libraries.
When trying to send a mail using idSMTP, the first time the component connects, I get an exception:
Could't load the SSL libraries
. Funny thing is, a retry works always. Debugging I found that the problem is in IsSSLOpenSSLHeader, function ...
Hey,
I am trying to checksum an image, but it takes too long to give a result, tried add values, and Adler-32 but both finishes in a long time (approximately 2 seconds).
Adding values:
Function Checksum_CountryFlag(Img : TPicture):Integer;
var j, k, Checksum : Integer;
begin
Checksum := 0;
For j := 0 to Img.Width do
For k := 0 to Img....
Hey,
I am trying to get the current pixel in an image by a "OnMouseMove event" Using Scanline.
something equivalent to this:
Label1.Caption := IntToStr(Image1.Picture.Bitmap.Canvas.Pixels[X,Y]);
Any ideas ?
...