Cannot compile madSecurity.pas in Delphi 2009

delphi package - easy access to security apis

Postby madshi » Tue Sep 15, 2009 7:00 pm

BenjyKid wrote:I might be reading this wrong, but wouldn't that have meant that lots of components would have worked only if this (global) switch was set to ANSI?

Not sure what you mean. I'd simply have activated this switch at the top of each unit and be done with it.

BenjyKid wrote:You do not need to support Win9x when UNICODE is defined, because Delphi 2009 applications won't run on Win9x.

For madsecurity.pas this means that all you would have needed to do is add a couple of {$IFNDEF UNICODE} windows 9x code {$ENDIF} and leave the rest of the file almost unchanged. And I'm almost sure that the WinNT Wide API functions work exactly like the ANSI functions. As a matter of fact, the exported ANSI functions are always wrappers around the Wide functions (there might be a few exceptions that confirm this rule). This might be different for undocumented stuff, but that seems to be relevant for Win9x only here.

I'm aware of all that. But things are not always as easy as they sound. madCollection is not a simple application. It calls loads of win32 APIs directly and does some funky string stuff at various places. Of course I could have left everything as "string" and then rely on Delphi 2009 getting things right and only fix whatever is obviously broken. But it would have been too much work to do it that way. Trust me, I tried. Ok, I don't know how much work it would have been for madSecurity. The problem is that even if you succeed to compile, you never know what works and what doesn't work. So I would have had to test every single bit of functionality to be sure that it really works. And that's a whole damn lot of work...

I just didn't want to release a madCollection build with dozens of hidden bugs in it. So I took the easy way out, namely converting "string" to "AnsiString" everywhere. Maybe I'll do a "proper" conversion later, but I'm currently dug in work over my head...
madshi
Site Admin
 
Posts: 9645
Joined: Sun Mar 21, 2004 5:25 pm

Previous

Return to madSecurity

Who is online

Users browsing this forum: No registered users and 1 guest