Re: [DUG] Stack Overflow in WndProc

2011-06-02 Thread Karl Reynolds
GetActiveWindow re-enters the message queue so I'm guessing that has something to do with it. Cheers, Karl On Fri, Jun 3, 2011 at 11:35 AM, ja...@software-solutions.co.nz ja...@software-solutions.co.nz wrote: Hi there, I have been experiencing a Stack Overflow error in my WndProc override

Re: [DUG] Maths problem for the day

2011-01-10 Thread Karl Reynolds
Max := Bias.Position * Trunc(Log10(Math.Max(10, High(Files) * 10 div 3))); That was my point, the original describes exactly what was intended. One liners generally don't and tend to introduce errors The etc kind of throws a spanner in the works. But yes, the following is slightly more

Re: [DUG] Christchurch DUG

2010-10-25 Thread Karl Reynolds
I would make an appearance if it was there. Cheers, Karl On Tue, Oct 26, 2010 at 9:45 AM, lbisman lbis...@clear.net.nz wrote: Is anyone interested in resurrecting the ChCh DUG ? - after the recent launch it didn't seem like there were many interested parties. We used to host it at the

Re: [DUG] TImage/ImageList/Transparent/XP Manifest

2010-02-25 Thread Karl Reynolds
Could try using ImageList_DrawEx explicitly? Image1.Height := ImageList1.Height; Image1.Width := ImageList1.Width; ImageList_DrawEx(ImageList1.Handle, ImageIndex, Image1.Canvas.Handle, 0, 0, 0, 0, CLR_NONE, CLR_NONE, 0); Cheers, Karl ___ NZ

Re: [DUG] Is it a bug in latest version of Delphi?

2010-02-15 Thread Karl Reynolds
One way to get around this would be to add your own descendant of TListBox and add an Objects property that works as you would expect (ie. use that instead of items.objects). Here's a quick sample I knocked together: unit MyListBox; interface uses SysUtils, Classes, Controls, StdCtrls,

Re: [DUG] Is it a bug in latest version of Delphi?

2010-02-15 Thread Karl Reynolds
On Tue, Feb 16, 2010 at 11:55 AM, Jolyon Smith jsm...@deltics.co.nz wrote: function ListBoxGetObject(const aListBox: TListBox; const aIndex: Integer): TObject; begin if (aIndex 0) or (aIndex = aListBox.Items.Count) then TStringsHelper(aListBox.Items).Error(SListIndexError, aIndex);

Re: [DUG] Is it a bug in latest version of Delphi?

2010-02-15 Thread Karl Reynolds
On Tue, Feb 16, 2010 at 1:55 PM, Alister Christie alis...@salespartner.co.nz wrote: I think the point I was trying to make is that it is that the method (/array indexer or whatever) was expecting a TObject - passing anything else could result in unexpected results. Only if you stipulate that

Re: [DUG] Is it a bug in latest version of Delphi?

2010-02-15 Thread Karl Reynolds
On Tue, Feb 16, 2010 at 2:50 PM, Kyley Harris ky...@harrissoftware.com wrote: interesting     if Longint(Result) = LB_ERR then Error(SListIndexError, Index); it would seem that the error is not in delphi at all. Well.. they are simply raising the Windows error which say that -1 is the error

Re: [DUG] Is it a bug in latest version of Delphi?

2010-02-15 Thread Karl Reynolds
On Tue, Feb 16, 2010 at 3:06 PM, Jolyon Smith jsm...@deltics.co.nz wrote: Win API returns -1 to indicate “an error”.  Any error.  Not a specific error.  Certainly not specifically a list index error. Pardon me for being pedantic, but while I agree with everything else you said, I feel the need

Re: [DUG] Is it a bug in latest version of Delphi?

2010-02-15 Thread Karl Reynolds
On Tue, Feb 16, 2010 at 3:57 PM, Jolyon Smith jsm...@deltics.co.nz wrote: Good luck with GetLastError(). There's nothing to indicate that LB_GETITEMDATA processing will set a Windows LastError. And empirically I would have to say that it doesn't: Hmm... empirically I would have to say it

Re: [DUG] Is it a bug in latest version of Delphi?

2010-02-15 Thread Karl Reynolds
 r := SendMessage(Listbox1.Handle, LB_GETITEMDATA, 100, 0);  if GetLastError 0 then    RaiseLastOSError;  if r = -1 then    ShowMessage('oops'); Will yield only the oops message, no OS error. Tested this code too. I get a system error, invalid index. How odd. Cheers, Karl

Re: [DUG] Is it a bug in latest version of Delphi?

2010-02-15 Thread Karl Reynolds
On Tue, Feb 16, 2010 at 4:34 PM, Jolyon Smith jsm...@deltics.co.nz wrote: D2006, and *I* get 0, -1, -1... no error On Tue, Feb 16, 2010 at 4:36 PM, Jolyon Smith jsm...@deltics.co.nz wrote: But since we're talking about behavior in the OS not the VCL or compiler, more pertinent perhaps is the

Re: [DUG] Is it a bug in latest version of Delphi?

2010-02-15 Thread Karl Reynolds
On Tue, Feb 16, 2010 at 4:43 PM, Kyley Harris ky...@harrissoftware.com wrote: I'll add my cents.. under Delphi 7, getlasterror returns error 1413 as Karl said.. under Delphi 2007 no errors whatsoever. whats clear is that Getlasterror is unlreliable in this situation as Microsoft says, because

Re: [DUG] Is it a bug in latest version of Delphi?

2010-02-15 Thread Karl Reynolds
On Tue, Feb 16, 2010 at 5:03 PM, Kyley Harris ky...@harrissoftware.com wrote: the fact that it behaves different under delphi 7 and Delphi 2007 on the same machine implies that there is some strange mystery at work in the compiled code that is not obvious. its not a direct problem of the

[DUG] Hiring again (Christchurch)

2010-02-03 Thread Karl Reynolds
/b-delphi-b-programmer-chocolate-fish-software/christchurch/16693700/82/1/ Email me if you're interested. Cheers, Karl Reynolds Director, Chocolate Fish Software Limited (03) 374 2581 ___ NZ Borland Developers Group - Delphi mailing list Post: delphi

Re: [DUG] Hiring again (Christchurch)

2010-02-03 Thread Karl Reynolds
On Thu, Feb 4, 2010 at 3:18 PM, David O'Brien d...@iccs.co.nz wrote: Do you require employee's to be on-site? Or can we work remotely? On site. I know, I know... Cheers, Karl Reynolds Director, Chocolate Fish Software Limited (03) 374 2581 ___ NZ

Re: [DUG] What is the future for Delphi programmer? + Delphi 4 PHP

2010-01-11 Thread Karl Reynolds
1. Still maintaining Delphi code? Yes. Over 200 police departments across 32 US states use our software. 2. Started a new Delphi project in the last year? Well it's mostly ongoing development in the same system, but yes, we are constantly adding more modules. 3. Started a new project in

Re: [DUG] CPU memory usage

2008-08-18 Thread Karl Reynolds
Use GlobalMemoryStatusEx (http://msdn.microsoft.com/en-us/library/aa366781(VS.85).aspx) Cheers, Carl On Mon, Aug 18, 2008 at 11:39 PM, Vikas... [EMAIL PROTECTED] wrote: Hi, I am creating a window service using delphi 5. I need some help is getting the CPU memory usage of the machine so that

Re: RE: [DUG] DBX4 drivers for firebird

2008-05-19 Thread Karl Reynolds
(Here we go with another optimistic post... maybe this one will make it to the list! Maybe) IMHO as soon as FB branched from IB6 it was really wishful thinking to expect that the IB driver (and it was always IB only) would always work with FB. In our case we were kind of forced into Firebird as

Re: [DUG] Speed of loading a Client DataSet

2007-12-05 Thread Karl Reynolds
It shouldn't be that slow. A quick test here of loading a CDS with 15K records finished in under half a second. Maybe you have some badly-behaved components around that don't properly respect your DisableControls/EnableControls? See if disconnecting your dataset from all datasources before loading

RE: [DUG] Dumb Friday Question

2007-05-03 Thread Karl Reynolds
It isn't different, but that's because: List := TStringList.Create; PopulateList(List); try if List.Count 0 then begin .do lots of stuff with the list End; Finally List.Free; End; is not safe. You need to move the PopulateList(List) inside the try/finally, and

RE: [DUG]: joining in update query

2003-08-11 Thread Karl Reynolds
Tracey Maule wrote: a shame you werent there yesterday before i set that field by hand. Sorry, I'm still in the US at the moment, and since I don't check the DUG every day I'm usually a little late with my replies. I didn't mean what I said to be quite as testy as it came out - I was just

RE: [DUG]: joining in update query

2003-08-10 Thread Karl Reynolds
Of course you can do this in Interbase. OTTOMH (I'm not at work right now): update TABLE1 t1 set updatefield = (( select t3.updatefield from TABLE2 t2, TABLE3 t3 Where t1.idfield = t2.idfield and t2.anotheridfield = t3.anotheridfield)) And you can add where t1 condition on the bottom if

RE: [DUG]: Interface Inheritance

2003-06-15 Thread Karl Reynolds
Max wrote: In certian situation you may not want IFirstDescendant to be available if ISecondDescendant is available, and so Delphi's behaviour is actually to your benefit as it allow comlpete control over exactly what interfaces an object makes available to QueryInterface. It is always better

RE: [DUG]: Interface Inheritance

2003-06-15 Thread Karl Reynolds
So this is one simple case where you have IStream inheriting from ISequentialStream (see ActiveX.pas) but you are not required to implement ISequentialStream is you are implementing IStream. Utterly bizarre. I get your point - that interface inheritance has to be implemented the way it is in