Friday, January 17, 2003, 10:54:37 AM, you wrote:

> As I wrote to you, you should use the _stdcall (or whatever
> underscores it needs - depending on compiler or WINAPI) as the calling
> convention for all functions. I think this is the reason the program
> does not go any further.

I've tried using _stdcall but it seems to make no difference.  I
assume this must be the default for mingw2?  Either way, the results
are the same.

> OK, here is how TBP_GetName (and any other function that returns
> information into a buffer) is called from TB! (C syntax here)

>  SizeNeeded = TBP_GetName(NULL, 0);
>  if (SizeNeeded > 0) {
>    Buffer = malloc(SizeNeeded);
>    CharsCopied = TBP_GetName(Buffer, SizeNeeded);
>  }

> In other words, the first call is made with the buffer parameter set
> to 0 (NULL in C, NIL in Delphi), so the calling function should return
> the size of the buffer it requires. The second call just collects
> Does it makes things more clear?

Yes, this is exactly what I see.  And I am returning the valid info,
yet no info is shown in the plugin options.  Here is what I see when
adding the plugin:

Loading spam plugin (DLLMAIN/DLL_PROCESS_ATTACH)
TBP_GetStatus(0)
TBP_NeedConfig(0)
TBSGetString: source='TB Spam', destination is null, size=0
TBSGetString: source='TB Spam', destination is valid, size=7
Unloading spam plugin (DLLMAIN/DLL_PROCESS_DETACH)

Checking the value of destination before I return show it contains the
correct string value.

RR>> 3) Shouldn't TBP_Setup pass the HWND of the preferences window (or
RR>> whatever window its called from)?

> Not necessarily - you can just call GetActiveWindow() if you need it
> :-)

Ah, thanks,

Rob


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

Reply via email to