Re[2]: TBP API - need help!

2003-02-13 Thread Mark Wieder
Petr-

Thursday, February 13, 2003, 4:59:33 PM, you wrote:

PP> As I stated, my comments are based on the AV API.

And excellent educated guesses, too.

>> It's actually the other way around... return 0 if there's no
>> configuration option, return non-zero if you *do* provide one.
PP> If is it so, than the TBP API is different.

This is the one case where the boolean return value makes sense to me
- return a zero (false) if you don't support a configuration option,
return a nonzero (true) if you do.

PP> Very old bug. Don't hold your breath. :)

 Actually, I'd be satisfied if TBP_NeedConfig() would just
enable the Configure button...

PP> Anyway, a lack of proper documentation of API is a pet peeve of mine.

Or, in this case, a lack of *any* real documentation. Stefan - I take
it that the API we're working with here is also going to be valid when
the fabled 2.0 release finally rears its head?

-Mark Wieder

 Using The Bat! v1.63 Beta/4 on Windows 2000 5.0 Build 2195 Service Pack 2
-- 



Current version is 1.62 | "Using TBDEV" information:
http://www.silverstones.com/thebat/TBUDLInfo.html



Re[2]: TBP API - need help!

2003-02-13 Thread Mark Wieder
Petr-

Just a couple of corrections here...

Thursday, February 13, 2003, 1:17:55 PM, you wrote:

>> function TBP_NeedConfig: Integer; stdcall;
PP> return 0 if you provide a configuration dialog.

It's actually the other way around... return 0 if there's no
configuration option, return non-zero if you *do* provide one.

>> function TBP_NeedCOM: Integer; stdcall;
PP> return 0 if your plugin will create instance of an COM object.
PP> TB! will call CoInitialize() before calling your plugin.

Not sure about this one. I just return a zero and it seems to be
ignored, which I think is what I want.

>> As I guess it must return "zero" if all is right. How other results are
>> interpreted? Just as "non-zero", or an exact value is also important?
PP> Zero is OK, any negative value is an error.

That seems to be the case. Personally, I'd rather use boolean values,
where the convention is zero=false, non-zero=true. But it seems TB's
API is structured using ints everywhere instead. And obviously,
TBP_GetSpamScore needs to return an actual score value.

>> And also what is the algorithm when The Bat! receives, for example
>> "TBP_NeedConfig=0"? Does it mean that in this case the "TBP_Setup" will
>> be called as the next function?
PP> Not really, if NeedConfig returns 0, a Setup can be called and the config
PP> button will be enabled. Also, if enabled by NeedConfig, TB! can call Setup
PP> after manual installation of the plugin (not sure about anti-spam
PP> plugins, is true for AV plugins).

That's the theory. In actuality, TBP_Setup *is* called immediately
after TBP_NeedConfig. Hopefully this will be fixed soon.

-Mark Wieder

 Using The Bat! v1.63 Beta/4 on Windows 2000 5.0 Build 2195 Service Pack 2
-- 



Current version is 1.62 | "Using TBDEV" information:
http://www.silverstones.com/thebat/TBUDLInfo.html