Archive for October, 2007

Delphi service debugging

Tuesday, October 30th, 2007

I’ve literally spent over 3 hours trying to egt a delphi 5 service debugged. I tried all mentioned stuff with process attaching, registry stuff, etc, nothing worked. then I bumped into this post from wilson:

that didn’t work out of the box eitehr because I’ve got an access violation on the line

while not Terminated do
  ServiceThread.ProcessRequests(True);// wait for termination

but I replaced that block of code with

if FindCmdLineSwitch('debug', ['/','-'], true) then
  while not Terminated do
  while not Terminated do
    ServiceThread.ProcessRequests(True);// wait for termination

and I can now debug my service just fine.

Related posts

Just added email banning to my phpld web directory

Friday, October 26th, 2007

There was this guy/girl that kept submitting entries using a * email address which always bounced back with a user unkown (the actual email address behind those addresses).
And per my rules, every submission that bounces back emails is rejected.
So, since I got tired of rejecting this ones submisisons, not mentionging that I have palced a message on the submission page stating that there is a problem with that email address (but they were probably using some atuomated tool), I spent more than 1 hour to write an email banning function/validator and now it works like a charm.

and now .. I can rest nicely 🙂

Related posts

The alternative to Quicktime Alternative

Tuesday, October 16th, 2007

well, as explained on [url=]wiki[/url] , quick time alternative is not exactly a "correct" choise. But there they also give an alternative, using the original quick time installer in [url=]this[/url] installation guide.

everything for the best 🙂

Related posts

Dell PC Restore on a vista laptop

Monday, October 15th, 2007

Problems in paradise. I’ve searched for hours on how to start the restoration to the factory defaults, since ctrl+f11 is not working on a vista laptop. finally, found this post
where the guy says that you shoul dgo into advanced boot menu (F8) and choose repair. you’ll have to log on as a local user (admin) and then choose the last option with factory image restore.

Related posts

Changing icon resource with madshis madres

Friday, October 12th, 2007

provide proper language and everything should work just fine.
function UpdateExeIcon(exeFile, iconGroup, icoFile: string; language: word) : boolean;
var resUpdateHandle : dword;
resUpdateHandle := BeginUpdateResourceW(PWideChar(wideString(exeFile)), false);
if resUpdateHandle <> 0 then
if (icongroup=’MAINICON’) or GetIconGroupResourceW(resUpdateHandle, PWideChar(wideString(iconGroup)), language, c) then
result := LoadIconGroupResourceW(resUpdateHandle, PWideChar(wideString(iconGroup)), language, PWideChar(wideString(icoFile)))
if StrToIntDef(iconGroup, -1)>-1 then
result := LoadIconGroupResourceW(resUpdateHandle, PWideChar(pointer(strtoint(iconGroup))), language, PWideChar(wideString(icoFile)))
result := false;
result := EndUpdateResourceW(resUpdateHandle, false) and result;
end else
result := false;

Related posts

Delphi IDE: the mistery of the blue dots unveiled

Tuesday, October 9th, 2007

Evry once in a while, you see those blue dots in wrong position. Usually, a few lines up/down then they should be. Executing in debug mode will also put the current executing line wrong. You will see that you enter a procedure and you are executing some lines from the var declaration.
This pisses you off, doesn’t it? You just can’t figure out why that happens.

Well, let me tell you: your source file has some unix-style line endings. That is, it does not have a CRLF (#13#10) but only a LF (#10).

How to fix it? Depends on what you like really. From a hex editor to windows notepad, anything is ok. Open it and replace the single LFs with CRLFs and you’re done.

Not your specific case? Then maybe you are actually compiling in a unit file from another place and have loaded in the debugger the wrong file. Happens if you keep multiple versions of the same file on the search path.

There are of course other cases too, maybe when I recall, I’ll post./

Happy debugging 🙂

Related posts

Achieving the impossible with delphi: ISAPI

Monday, October 1st, 2007

well, I am working on some ISAPI filter stuff and jsut bumped into the following MSDN article:
Both ISAPI filters and ISAPI extensions can only be developed using C/C++.
I can only say one thing: [img:0b1900ad51][/img:0b1900ad51]

Related posts