Friday, December 17, 2004

F12 brings up CPU debugger window?

In Delphi, if you're debugging an app which has F12 as a shortcut key for some command, then you're most likely going to get very ticked off by having Delphi "break" when you hit F12. This is because F12 is the "UserDebuggerKey" on Windows 2000 and above, by default. What this means is that if a program is being debugged, hitting the UserDebuggerKey will break into the debugger - and Delphi shows you a nice little CPU window.

To get rid of this problem, you can reassign the UserDebuggerKey by changing the registry. There's a Microsoft support page that details the key (HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug) and what values you can use.

I would think "Pause" would be a better key to use - makes more sense to me, since the only time I've used it ever has been in the boot process and when getting to the System Properties screen (WinKey + Pause). Both of which I'm unlikely to be desperate for when debugging.

Tuesday, December 14, 2004

Firefox beats IE?

Seems like FireFox has made some serious headway in the world of "people who read my blog". According to the latest stats, 47.4% of the hits on my site are through FireFox and only 42.1% on IE. Last time I checked was a VERY long time back - it was more like 92% IE then.

Not that my site is any indicator or trendsetter, of course. But...wow.

Monday, December 13, 2004

Excel users...

If you use Excel quite a bit, check out http://www.exceluser.com/. This is an awesome site, with sample dashboards, formula explanations (what's MIRR? I never thought I'd need to know) and some more. Good stuff.

Why do I need Excel? Running a small company too requires that we track trends, competition, tasks and so on. Plus the whole financial jungle that comes with being a Director.

Saturday, December 11, 2004

Suggestions on a web page?

Autocomplete's next avatar? Check out Google Suggest. Amazing concept this - supposedly uses XmlHttpRequest and tons of obfuscated Javascript.

From the slashdot comments, I've got the link that actually gets you the details:
http://www.google.com/complete/search?hl=en&js=true&qu=chicken.

Gets one thinking, doesn't it?

Friday, December 03, 2004

Bug in Delphi SOAP: arrays of TByteDynarrays don't work well.

There's a bug in the Delphi SOAP source code when using parameters like:


type
MultiArray = array of TByteDynArray;


To fix this, first add $(DELPHI)\Source\Soap to your search path, or copy the file
OPtoSOAPDOMConv.pas to your local directory.

then modify the file as follows:

1. Locate the function ConvertSoapToNativeArrayElem.

2. add the following as a subfunction:

// DEEPAK changed 3.12.2004 fix for arrays of
// TByteDynArray
function TestDimDynArray( var Res : Pointer ) : boolean;
var ArrayLen : integer;
DynP : Pointer;
TypeURI, TYpeName : InvString;
S : string;
begin
result := False;
GetElementType(Node, TypeURI, TypeName);
if (Dims = 1) and
((ElemInfo.Kind = tkInteger) or
(ElemInfo.Kind = tkChar)) and
(GetTypeData(ElemInfo).OrdType = otUByte) and
{ Some SOAP implementations don't
send the XML Namespace!! }
(((TypeName ='base64Binary')) or
((TypeURI = SSoap11EncodingS5) and
(TypeName = 'base64')) or
{ Some SOAP implementations don't
send the type!! }
(TypeName = '' )) then
begin
S := DecodeString(Node.Text);
ArrayLen := Length(S);
DynP := Pointer(PInteger(DataP)^);
DynArraySetLength(DynP, TypeInfo(TByteDynArray),
1, @ArrayLen);
Move(S[1], DynP^, Length(S));
Res := DynP;
Result := True;
end;
end;
// end DEEPAK

3. in the procedure, after following code:

end else if Dims = 1 then
begin

add:

// DEEPAK 03.12.2004 line added

if not TestDimDynArray(Result) then
begin
[ NOW put everything from
Size := ntElementChildCount(Node);
to
if Size > 0 then
ReadRow(RootNode, Node, CurElem,
Size, PElem, ElemInfo);
in this block]
end;

(essentially, byte dynarrays must be handled differently, even when you
have an array of bytearrays)

Delphi 7: Library path edit dialog too small?

It's kinda irritating to have to resize the Delphi library path (Tools|Environment Options|Library tab, first "..." button) edit dialog so small - it's resizable, but it doesn't "remember" the size. There might be other solutions to this, like writing an IDE expert. But I got down to solving it the "brute force" way.

I downloaded PE Resource Explorer from Colin Wilson's (excellent) Delphi Site, and used it to open coride70.bpl in my Delphi bin folder. I then opened up the RCDATA section, and browsed to the entry named "TORDEREDLISTDLG". On the right, after selecting the Neutral subnode, I found the DFM definition of TOrderedListDlg, which is the dialog displayed. (How did I find out? Spy++ is my friend.)

Using complex mathematical techniques such as addition and subtraction (done using excel, of course) I changed the width, height, top and/or bottom of whatever I wanted to change. Essentially I've made the dialog 500x450 now, a much better size to work with. I've uploaded this definition as a text file, so you can download it here.

Note: You'll have to use PE explorer and change this in coride70.bpl, save the changes and run Delphi again to check. Take a backup. Please. Only tried with Delphi 7. If you want different resolutions, do the calculations yourself. Your mileage may vary, and if it does, it isn't my fault.