Ali Keshavarz's Website
RSS icon Home icon
  • Boolean and BOOL

    Posted on November 5th, 2011 Ali Keshavarz 5 comments

    It took me an hour to fix an Access Violation in one of my source codes tonight. The AV caught my eyes when I thought everything was done correctly, and it is ready for committing changes and hit the bed!

    It was a vague AV, giving me just a few NT OS functions in call stack trace, and stopping on any line containing Result (as the return value for a property getter). I reviewed the code several times, everything seemed OK, and I had only changed tens of lines of code, so I was really confused where the hell this AV came from; I mean, I knew which property getter method was causing the error, and the method was not lengthy or complicated, but I had no clue how come it was causing such an AV >-(

    Eventually while I was reviewing the changed codes again and again, I noticed something; there was a Windows API call which required a PBOOL parameter, and I had called it twice in the function code. One call was written a while ago, and the other was written tonight. The problem was, for the second call I had defined the parameter as Boolean rather than defining it as BOOL (passing its address using @ operator). That’s a shame!

    So here’s a personal note for myself: Do not code at 2 AM, specially when you are kinda sleepy. If you did, make sure your eyes can distinguish between BOOL, and Boolean :)

  • My View on New Delphi Roadmap

    Posted on May 13th, 2010 Ali Keshavarz 1 comment

    Embarcadero published a new roadmap for Delphi on May 10. You can see the new roadmap here.

    I don’t know if we can call it a roadmap or not. It does not give any time schedule or estimation on when each mentioned feature might be available (except a rough estimation for 64-bit compiler preview availability in the first half of 2011). To me, the published roadmap does not clear any ambiguity regarding Delphi future. It just adds more to it! Really, what was the purpose of publishing this?! Maybe just to  muffle those Delphi users who were complaining about not having any updated roadmap.

    Now, let’s take a look at this so-called roadmap…

    Read the rest of this entry »